{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#   [Py4Hw User Guide](../UserGuide.ipynb)> 1.1 Design Style\n",
    "###  [Next: 1.2 Object Oriented Approach](OO.ipynb)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Hardware design tools typically combine different design styles. \n",
    "\n",
    "1. Graphical\n",
    "    1. Structural\n",
    "2. Textual (HDL)\n",
    "    1. Structural\n",
    "    2. Register Transfer Level (RTL)\n",
    "    3. Sequential Behavioural (Procedural Programming Languages)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Textual description of Hardware is done by Hardware description languages (HDL). Most popular ones are Verilog, SystemVerilog, VHDL, Chisel (based in Scala), and MyHDL (also based on Python). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In **py4hw** we promote the use of structural design style, by reusing as much as possible already designed and proven modules, but we also support RTL and sequential design styles."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In structural design styles a hardware module is build by instantiating other hardware modules and connecting them with wires.\n",
    "\n",
    "Thus, to create a circuit, the hardware designer has to reuse existing available blocks and create new ones when needed.\n",
    "\n",
    "By doing that, the design ends up being a set of blocks with a hierarchycal dependence. For instance, let A,B,C,D,E,F be preexisting logic blocks, and A being composed by B and C, and E being composed by A and F. If a hardware designer builds a circuit g reusing A and using a newly created block h using D and E. The hierarchical description of the circuit g would be the following. \n",
    "\n",
    "<pre>\n",
    "g \n",
    "+- A\n",
    "|  +- B\n",
    "|  +- C\n",
    "+--h\n",
    "   +- D\n",
    "   +- E\n",
    "      +- A\n",
    "      |  +- B\n",
    "      |  +- C\n",
    "      +- F\n",
    "</pre>\n",
    "  \n",
    "In this case we would say that g is the **top level entity** of the hierarchy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import py4hw"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "circuit created\n"
     ]
    }
   ],
   "source": [
    "# Imagine the following example\n",
    "sys = py4hw.HWSystem()\n",
    "\n",
    "inc = py4hw.Wire(sys, 'inc', 1)\n",
    "count = py4hw.Wire(sys, 'count', 8)\n",
    "q = py4hw.Wire(sys, 'q', 8)\n",
    "\n",
    "py4hw.Constant(sys, 'inc', 1, inc)\n",
    "py4hw.Add(sys, 'counter', q, inc, count)\n",
    "py4hw.Reg(sys, 'reg', d=count, enable=inc, q=q)\n",
    "\n",
    "print('circuit created')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The following code shows prints the hierarchy of the system "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HWSystem\n",
      " Constant\n",
      " Add\n",
      " Reg\n"
     ]
    }
   ],
   "source": [
    "py4hw.debug.printHierarchy(sys)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Structural Design Style\n",
    "Structural design consist on creating instances of other elements.\n",
    "In **py4hw** this is done in the constructor of the class that implements the circuit."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Counter(py4hw.Logic):\n",
    "    def __init__(self, parent, name, inc, q):\n",
    "        super().__init__(parent, name)\n",
    "    \n",
    "        self.addIn('inc', inc)\n",
    "        self.addOut('q', q)\n",
    "        \n",
    "        count = py4hw.Wire(sys, 'count', 8)\n",
    "\n",
    "        py4hw.Add(self, 'counter', q, inc, count)\n",
    "        py4hw.Reg(self, 'reg', d=count, enable=inc, q=q)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "circuit created\n"
     ]
    },
    {
     "data": {
      "image/png": "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",
      "text/plain": [
       "<Figure size 345x268 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "sys = py4hw.HWSystem()\n",
    "\n",
    "inc = py4hw.Wire(sys, 'inc', 1)\n",
    "q = py4hw.Wire(sys, 'q', 8)\n",
    "\n",
    "py4hw.Constant(sys, 'inc', 1, inc)\n",
    "\n",
    "Counter(sys, 'counter', inc, q)\n",
    "\n",
    "print('circuit created')\n",
    "\n",
    "sch = py4hw.Schematic(sys.children['counter'])\n",
    "sch.draw()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## RTL Design Style\n",
    "Not all the circuits can be described structurally.\n",
    "\n",
    "Some circuit primitives (like and, and or gates and registers) are already described behaviourally in the py4hw library.\n",
    "\n",
    "There are two types of behavioural descriptions: combinational and sequential.\n",
    "\n",
    "Combinational circuits are modelled by implementing the **propagate** method.\n",
    "\n",
    "Sequential circuits are modelled by implementing the **clock** method.\n",
    "\n",
    "Since ports are dynamically created in the class constructor, to have them available in the clock or propagate methods they are typically also stored as members of the circuit class.\n",
    "\n",
    "<pre>\n",
    "self.&ltport name&gt = self.addIn('&ltport name&gt', &ltport name&gt)\n",
    "</pre>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "class CounterRTL(py4hw.Logic):\n",
    "    def __init__(self, parent, name, inc, q):\n",
    "        super().__init__(parent, name)\n",
    "    \n",
    "        self.inc = self.addIn('inc', inc)\n",
    "        self.q = self.addOut('q', q)\n",
    "        \n",
    "        \n",
    "    def clock(self):\n",
    "        if (self.inc.get() == 1):\n",
    "            self.q.prepare(self.q.get()+1)\n",
    "        \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can create the circuit, and test it to see it is totally equivalent to the structural description"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "circuit created\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<script>var WaveSkin=WaveSkin||{};WaveSkin.default=[\"svg\",{\"id\":\"svg\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"height\":\"0\"},[\"style\",{\"type\":\"text/css\"},\"text{font-size:11pt;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;fill-opacity:1;font-family:Helvetica}.muted{fill:#aaa}.warning{fill:#f6b900}.error{fill:#f60000}.info{fill:#0041c4}.success{fill:#00ab00}.h1{font-size:33pt;font-weight:bold}.h2{font-size:27pt;font-weight:bold}.h3{font-size:20pt;font-weight:bold}.h4{font-size:14pt;font-weight:bold}.h5{font-size:11pt;font-weight:bold}.h6{font-size:8pt;font-weight:bold}.s1{fill:none;stroke:#000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none}.s2{fill:none;stroke:#000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none}.s3{color:#000;fill:none;stroke:#000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 3;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s4{color:#000;fill:none;stroke:#000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible}.s5{fill:#fff;stroke:none}.s6{color:#000;fill:#ffffb4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s7{color:#000;fill:#ffe0b9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s8{color:#000;fill:#b9e0ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s9{fill:#000;fill-opacity:1;stroke:none}.s10{color:#000;fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s11{fill:#0041c4;fill-opacity:1;stroke:none}.s12{fill:none;stroke:#0041c4;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none}\"],[\"defs\",[\"g\",{\"id\":\"socket\"},[\"rect\",{\"y\":\"15\",\"x\":\"6\",\"height\":\"20\",\"width\":\"20\"}]],[\"g\",{\"id\":\"pclk\"},[\"path\",{\"d\":\"M0,20 0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"nclk\"},[\"path\",{\"d\":\"m0,0 0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"000\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0m0\"},[\"path\",{\"d\":\"m0,20 3,0 3,-10 3,10 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0m1\"},[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mx\"},[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 5,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 4,16\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0md\"},[\"path\",{\"d\":\"m8,20 10,0\",\"class\":\"s3\"}],[\"path\",{\"d\":\"m0,20 5,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mu\"},[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10.107603,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mz\"},[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"111\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1m0\"},[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1m1\"},[\"path\",{\"d\":\"M0,0 3,0 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mx\"},[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M3.5,1.5 5,0\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"1md\"},[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mu\"},[\"path\",{\"d\":\"M0,0 5,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M8,0 18,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"1mz\"},[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xxx\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 10,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 15,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 20,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M5,20 20,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,20 20,10\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m15,20 5,-5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xm0\"},[\"path\",{\"d\":\"M0,0 4,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 4,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M5,20 8,17\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xm1\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 4,20 9,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 9,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 5,15\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmx\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 10,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 15,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 20,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M5,20 20,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,20 20,10\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m15,20 5,-5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmd\"},[\"path\",{\"d\":\"m0,0 4,0 c 3,10 6,20 16,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 4,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 5.5,4.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6.5,8.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 8,12\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m5,20 5,-5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m10,20 2.5,-2.5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmu\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 4,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 10,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 10,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 6,14\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmz\"},[\"path\",{\"d\":\"m0,0 4,0 c 6,10 11,10 16,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 4,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 4.5,0.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 6.5,3.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 8.5,6.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 11.5,8.5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"ddd\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"dm0\"},[\"path\",{\"d\":\"m0,20 10,0\",\"class\":\"s3\"}],[\"path\",{\"d\":\"m12,20 8,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dm1\"},[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dmx\"},[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 5,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 4,16\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dmd\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"dmu\"},[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10.107603,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dmz\"},[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"uuu\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"um0\"},[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"um1\"},[\"path\",{\"d\":\"M0,0 10,0\",\"class\":\"s3\"}],[\"path\",{\"d\":\"m12,0 8,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umx\"},[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M3.5,1.5 5,0\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"umd\"},[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umu\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"umz\"},[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s4\"}]],[\"g\",{\"id\":\"zzz\"},[\"path\",{\"d\":\"m0,10 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zm0\"},[\"path\",{\"d\":\"m0,10 6,0 3,10 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zm1\"},[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmx\"},[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6.5,8.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"zmd\"},[\"path\",{\"d\":\"m0,10 7,0 c 3,5 8,10 13,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmu\"},[\"path\",{\"d\":\"m0,10 7,0 C 10,5 15,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmz\"},[\"path\",{\"d\":\"m0,10 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"gap\"},[\"path\",{\"d\":\"m7,-2 -4,0 c -5,0 -5,24 -10,24 l 4,0 C 2,22 2,-2 7,-2 z\",\"class\":\"s5\"}],[\"path\",{\"d\":\"M-7,22 C -2,22 -2,-2 3,-2\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M-3,22 C 2,22 2,-2 7,-2\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-3\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-3\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-3\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-3\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-3\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-3\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-3\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-3\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-3\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-4\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-4\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-5\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-5\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-4\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-4\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-4\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-4\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-4\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-4\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-4\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-5\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-5\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-5\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-5\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-5\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-5\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-5\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"Pclk\"},[\"path\",{\"d\":\"M-3,12 0,3 3,12 C 1,11 -1,11 -3,12 z\",\"class\":\"s9\"}],[\"path\",{\"d\":\"M0,20 0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"Nclk\"},[\"path\",{\"d\":\"M-3,8 0,17 3,8 C 1,9 -1,9 -3,8 z\",\"class\":\"s9\"}],[\"path\",{\"d\":\"m0,0 0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-2\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-2\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-2\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-2\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-2\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-2\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-2\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-2\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-2\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"arrow0\"},[\"path\",{\"d\":\"m-12,-3 9,3 -9,3 c 1,-2 1,-4 0,-6 z\",\"class\":\"s11\"}],[\"path\",{\"d\":\"M0,0 -15,0\",\"class\":\"s12\"}]],[\"marker\",{\"id\":\"arrowhead\",\"style\":\"fill:#0041c4\",\"markerHeight\":\"7\",\"markerWidth\":\"10\",\"markerUnits\":\"strokeWidth\",\"viewBox\":\"0 -4 11 8\",\"refX\":\"15\",\"refY\":\"0\",\"orient\":\"auto\"},[\"path\",{\"d\":\"M0 -4 11 0 0 4z\"}]],[\"marker\",{\"id\":\"arrowtail\",\"style\":\"fill:#0041c4\",\"markerHeight\":\"7\",\"markerWidth\":\"10\",\"markerUnits\":\"strokeWidth\",\"viewBox\":\"-11 -4 11 8\",\"refX\":\"-15\",\"refY\":\"0\",\"orient\":\"auto\"},[\"path\",{\"d\":\"M0 -4 -11 0 0 4z\"}]]],[\"g\",{\"id\":\"waves\"},[\"g\",{\"id\":\"lanes\"}],[\"g\",{\"id\":\"groups\"}]]];\n",
       "</script><script>/*! wavedrom 2016-07-28 */\n",
       "!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i=\"function\"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error(\"Cannot find module '\"+g+\"'\");throw j.code=\"MODULE_NOT_FOUND\",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f=\"function\"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){\"use strict\";function d(a,b){function c(a){var b=parseInt(e.style.left,10),d=parseInt(e.style.top,10);(a.x<b||a.x>b+e.offsetWidth||a.y<d||a.y>d+e.offsetHeight)&&(e.parentNode.removeChild(e),document.body.removeEventListener(\"mousedown\",c,!1))}var d,e;d=document.getElementById(b+a),d.childNodes[0].addEventListener(\"contextmenu\",function(f){var g,h,i;e=document.createElement(\"div\"),e.className=\"wavedromMenu\",e.style.top=f.y+\"px\",e.style.left=f.x+\"px\",g=document.createElement(\"ul\"),h=document.createElement(\"li\"),h.innerHTML=\"Save as PNG\",g.appendChild(h),i=document.createElement(\"li\"),i.innerHTML=\"Save as SVG\",g.appendChild(i),e.appendChild(g),document.body.appendChild(e),h.addEventListener(\"click\",function(){var f,g,h,i,j,k,l,m;f=\"\",0!==a&&(g=document.getElementById(b+0),f+=g.innerHTML.substring(166,g.innerHTML.indexOf('<g id=\"waves_0\">'))),f=[d.innerHTML.slice(0,166),f,d.innerHTML.slice(166)].join(\"\"),h=\"data:image/svg+xml;base64,\"+btoa(f),i=new Image,i.src=h,j=document.createElement(\"canvas\"),j.width=i.width,j.height=i.height,k=j.getContext(\"2d\"),k.drawImage(i,0,0),l=j.toDataURL(\"image/png\"),m=document.createElement(\"a\"),m.href=l,m.download=\"wavedrom.png\",m.click(),e.parentNode.removeChild(e),document.body.removeEventListener(\"mousedown\",c,!1)},!1),i.addEventListener(\"click\",function(){var f,g,h,i;f=\"\",0!==a&&(g=document.getElementById(b+0),f+=g.innerHTML.substring(166,g.innerHTML.indexOf('<g id=\"waves_0\">'))),f=[d.innerHTML.slice(0,166),f,d.innerHTML.slice(166)].join(\"\"),h=\"data:image/svg+xml;base64,\"+btoa(f),i=document.createElement(\"a\"),i.href=h,i.download=\"wavedrom.svg\",i.click(),e.parentNode.removeChild(e),document.body.removeEventListener(\"mousedown\",c,!1)},!1),e.addEventListener(\"contextmenu\",function(a){a.preventDefault()},!1),document.body.addEventListener(\"mousedown\",c,!1),f.preventDefault()},!1)}b.exports=d},{}],2:[function(a,b,c){\"use strict\";var d=a(\"./jsonml-parse\");b.exports=d},{\"./jsonml-parse\":15}],3:[function(a,b,c){\"use strict\";function d(){f(0,e(\"InputJSON_0\"),\"WaveDrom_Display_\")}var e=a(\"./eva\"),f=a(\"./render-wave-form\");b.exports=d},{\"./eva\":4,\"./render-wave-form\":28}],4:[function(require,module,exports){\"use strict\";function eva(id){function erra(a){return{signal:[{name:[\"tspan\",[\"tspan\",{class:\"error h5\"},\"Error: \"],a.message]}]}}var TheTextBox,source;if(TheTextBox=document.getElementById(id),TheTextBox.type&&\"textarea\"===TheTextBox.type)try{source=eval(\"(\"+TheTextBox.value+\")\")}catch(a){return erra(a)}else try{source=eval(\"(\"+TheTextBox.innerHTML+\")\")}catch(a){return erra(a)}if(\"[object Object]\"!==Object.prototype.toString.call(source))return erra({message:'[Semantic]: The root has to be an Object: \"{signal:[...]}\"'});if(source.signal){if(\"[object Array]\"!==Object.prototype.toString.call(source.signal))return erra({message:'[Semantic]: \"signal\" object has to be an Array \"signal:[]\"'})}else{if(!source.assign)return erra({message:'[Semantic]: \"signal:[...]\" or \"assign:[...]\" property is missing inside the root Object'});if(\"[object Array]\"!==Object.prototype.toString.call(source.assign))return erra({message:'[Semantic]: \"assign\" object hasto be an Array \"assign:[]\"'})}return source}module.exports=eva},{}],5:[function(a,b,c){\"use strict\";function d(a){var b=0,c=0,d=[];return a.forEach(function(a){\"vvv-2\"===a||\"vvv-3\"===a||\"vvv-4\"===a||\"vvv-5\"===a?c+=1:0!==c&&(d.push(b-(c+1)/2),c=0),b+=1}),0!==c&&d.push(b-(c+1)/2),d}b.exports=d},{}],6:[function(a,b,c){\"use strict\";function d(a,b,c){var d,e,f=[];if(4===a.length){for(e=0;e<c;e+=1){for(f.push(a[0]),d=0;d<b;d+=1)f.push(a[1]);for(f.push(a[2]),d=0;d<b;d+=1)f.push(a[3])}return f}for(1===a.length&&a.push(a[0]),f.push(a[0]),d=0;d<c*(2*(b+1))-1;d+=1)f.push(a[1]);return f}b.exports=d},{}],7:[function(a,b,c){\"use strict\";function d(a,b,c){var d;switch(d=[],a){case\"p\":d=e([\"pclk\",\"111\",\"nclk\",\"000\"],b,c);break;case\"n\":d=e([\"nclk\",\"000\",\"pclk\",\"111\"],b,c);break;case\"P\":d=e([\"Pclk\",\"111\",\"nclk\",\"000\"],b,c);break;case\"N\":d=e([\"Nclk\",\"000\",\"pclk\",\"111\"],b,c);break;case\"l\":case\"L\":case\"0\":d=e([\"000\"],b,c);break;case\"h\":case\"H\":case\"1\":d=e([\"111\"],b,c);break;case\"=\":d=e([\"vvv-2\"],b,c);break;case\"2\":d=e([\"vvv-2\"],b,c);break;case\"3\":d=e([\"vvv-3\"],b,c);break;case\"4\":d=e([\"vvv-4\"],b,c);break;case\"5\":d=e([\"vvv-5\"],b,c);break;case\"d\":d=e([\"ddd\"],b,c);break;case\"u\":d=e([\"uuu\"],b,c);break;case\"z\":d=e([\"zzz\"],b,c);break;default:d=e([\"xxx\"],b,c)}return d}var e=a(\"./gen-brick\");b.exports=d},{\"./gen-brick\":6}],8:[function(a,b,c){\"use strict\";function d(a,b,c){var d,f,g,h,i,j,k,l,m,n,o,p,q,r,s;return d={p:\"pclk\",n:\"nclk\",P:\"Pclk\",N:\"Nclk\",h:\"pclk\",l:\"nclk\",H:\"Pclk\",L:\"Nclk\"},f={0:\"0\",1:\"1\",x:\"x\",d:\"d\",u:\"u\",z:\"z\",\"=\":\"v\",2:\"v\",3:\"v\",4:\"v\",5:\"v\"},g={0:\"\",1:\"\",x:\"\",d:\"\",u:\"\",z:\"\",\"=\":\"-2\",2:\"-2\",3:\"-3\",4:\"-4\",5:\"-5\"},h={p:\"0\",n:\"1\",P:\"0\",N:\"1\",h:\"1\",l:\"0\",H:\"1\",L:\"0\",0:\"0\",1:\"1\",x:\"x\",d:\"d\",u:\"u\",z:\"z\",\"=\":\"v\",2:\"v\",3:\"v\",4:\"v\",5:\"v\"},i={p:\"\",n:\"\",P:\"\",N:\"\",h:\"\",l:\"\",H:\"\",L:\"\",0:\"\",1:\"\",x:\"\",d:\"\",u:\"\",z:\"\",\"=\":\"-2\",2:\"-2\",3:\"-3\",4:\"-4\",5:\"-5\"},j={p:\"111\",n:\"000\",P:\"111\",N:\"000\",h:\"111\",l:\"000\",H:\"111\",L:\"000\",0:\"000\",1:\"111\",x:\"xxx\",d:\"ddd\",u:\"uuu\",z:\"zzz\",\"=\":\"vvv-2\",2:\"vvv-2\",3:\"vvv-3\",4:\"vvv-4\",5:\"vvv-5\"},k={p:\"nclk\",n:\"pclk\",P:\"nclk\",N:\"pclk\"},l={p:\"000\",n:\"111\",P:\"000\",N:\"111\"},m={hp:\"111\",Hp:\"111\",ln:\"000\",Ln:\"000\",nh:\"111\",Nh:\"111\",pl:\"000\",Pl:\"000\"},n=a.split(\"\"),o=j[n[1]],p=d[n[1]],void 0===p?(q=f[n[1]],void 0===q?e([\"xxx\"],b,c):(r=h[n[0]],void 0===r?e([\"xxx\"],b,c):e([r+\"m\"+q+i[n[0]]+g[n[1]],o],b,c))):(s=m[a],void 0!==s&&(p=s),q=k[n[1]],void 0===q?e([p,o],b,c):e([p,o,q,l[n[1]]],b,c))}var e=a(\"./gen-brick\");b.exports=d},{\"./gen-brick\":6}],9:[function(a,b,c){\"use strict\";var d=a(\"./process-all\"),e=a(\"./eva\"),f=a(\"./render-wave-form\"),g=a(\"./editor-refresh\");b.exports={processAll:d,eva:e,renderWaveForm:f,editorRefresh:g}},{\"./editor-refresh\":3,\"./eva\":4,\"./process-all\":21,\"./render-wave-form\":28}],10:[function(a,b,c){\"use strict\";function d(a,b){for(var c,d;b.childNodes.length;)b.removeChild(b.childNodes[0]);d=[\"svg\",{id:\"svgcontent_\"+a,xmlns:f.svg,\"xmlns:xlink\":f.xlink,overflow:\"hidden\"},[\"style\",\".pinname {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:end; font-family:Helvetica} .wirename {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:start; font-family:Helvetica} .wirename:hover {fill:blue} .gate {color:#000; fill:#ffc; fill-opacity: 1;stroke:#000; stroke-width:1; stroke-opacity:1} .gate:hover {fill:red !important; } .wire {fill:none; stroke:#000; stroke-width:1; stroke-opacity:1} .grid {fill:#fff; fill-opacity:1; stroke:none}\"]],c=e(d),b.insertBefore(c,null)}var e=a(\"./create-element\"),f=a(\"./w3\");b.exports=d},{\"./create-element\":2,\"./w3\":30}],11:[function(a,b,c){\"use strict\";function d(a,b,c,d){for(var h,i,j;b.childNodes.length;)b.removeChild(b.childNodes[0]);for(i in g)break;j=g.default||g[i],c&&c.config&&c.config.skin&&g[c.config.skin]&&(j=g[c.config.skin]),0===a?(d.xs=Number(j[3][1][2][1].width),d.ys=Number(j[3][1][2][1].height),d.xlabel=Number(j[3][1][2][1].x),d.ym=Number(j[3][1][2][1].y)):j=[\"svg\",{id:\"svg\",xmlns:f.svg,\"xmlns:xlink\":f.xlink,height:\"0\"},[\"g\",{id:\"waves\"},[\"g\",{id:\"lanes\"}],[\"g\",{id:\"groups\"}]]],j[j.length-1][1].id=\"waves_\"+a,j[j.length-1][2][1].id=\"lanes_\"+a,j[j.length-1][3][1].id=\"groups_\"+a,j[1].id=\"svgcontent_\"+a,j[1].height=0,h=e(j),b.insertBefore(h,null)}var e=a(\"./create-element\"),f=a(\"./w3\"),g=a(\"./wave-skin\");b.exports=d},{\"./create-element\":2,\"./w3\":30,\"./wave-skin\":32}],12:[function(a,b,c){\"use strict\";function d(a,b,c){\"string\"==typeof c&&(c=new Function(\"event\",c)),\"function\"==typeof c&&(a[b]=c)}function e(a,b){if(b.name&&document.attachEvent)try{var c=document.createElement(\"<\"+a.tagName+\" name='\"+b.name+\"'>\");a.tagName===c.tagName&&(a=c)}catch(a){console.log(a)}for(var e in b)if(b.hasOwnProperty(e)){var i=b[e];e&&null!==i&&\"undefined\"!=typeof i&&(e=f[e.toLowerCase()]||e,\"style\"===e?\"undefined\"!=typeof a.style.cssText?a.style.cssText=i:a.style=i:h[e]?(d(a,e,i),g[e]&&d(a,g[e],i)):\"string\"==typeof i||\"number\"==typeof i||\"boolean\"==typeof i?(a.setAttribute(e,i),g[e]&&a.setAttribute(g[e],i)):(a[e]=i,g[e]&&(a[g[e]]=i)))}return a}var f={rowspan:\"rowSpan\",colspan:\"colSpan\",cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",tabindex:\"tabIndex\",accesskey:\"accessKey\",hidefocus:\"hideFocus\",usemap:\"useMap\",maxlength:\"maxLength\",readonly:\"readOnly\",contenteditable:\"contentEditable\"},g={enctype:\"encoding\",onscroll:\"DOMMouseScroll\"},h=function(a){for(var b,c={};a.length;)b=a.shift(),c[\"on\"+b.toLowerCase()]=b;return c}(\"blur,change,click,dblclick,error,focus,keydown,keypress,keyup,load,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,resize,scroll,select,submit,unload\".split(\",\"));b.exports=e},{}],13:[function(a,b,c){\"use strict\";function d(a,b){b&&(a.tagName&&\"style\"===a.tagName.toLowerCase()&&document.createStyleSheet?a.cssText=b:a.canHaveChildren!==!1&&a.appendChild(b))}b.exports=d},{}],14:[function(a,b,c){\"use strict\";function d(a){var b=document.createElement(\"div\");if(b.innerHTML=a,e(b),1===b.childNodes.length)return b.firstChild;for(var c=document.createDocumentFragment?document.createDocumentFragment():document.createElement(\"\");b.firstChild;)c.appendChild(b.firstChild);return c}var e=a(\"./jsonml-trim-whitespace\");b.exports=d},{\"./jsonml-trim-whitespace\":16}],15:[function(a,b,c){\"use strict\";function d(a){return a instanceof Array&&\"string\"==typeof a[0]}function e(a,b,c){return document.createTextNode(\"[\"+a+\"-\"+c+\"]\")}var f,g,h=a(\"./jsonml-hydrate\"),i=a(\"./w3\"),j=a(\"./jsonml-append-child\"),k=a(\"./jsonml-add-attributes\"),l=a(\"./jsonml-trim-whitespace\"),m=null;f=function(a,b,c){for(var d=1;d<b.length;d++)b[d]instanceof Array||\"string\"==typeof b[d]?j(a,g(b[d],c)):b[d]&&b[d].value?j(a,h(b[d].value)):\"object\"==typeof b[d]&&null!==b[d]&&1===a.nodeType&&(a=k(a,b[d]));return a},g=function(a,b){var c;try{if(!a)return null;if(\"string\"==typeof a)return document.createTextNode(a);if(a&&a.value)return h(a.value);if(!d(a))throw new SyntaxError(\"invalid JsonML\");var k=a[0];if(!k){for(var n=document.createDocumentFragment?document.createDocumentFragment():document.createElement(\"\"),o=2;o<a.length;o++)j(n,g(a[o],b));return l(n),1===n.childNodes.length?n.firstChild:n}return\"style\"===k.toLowerCase()&&document.createStyleSheet?(f(document.createStyleSheet(),a,b),null):(c=f(document.createElementNS(i.svg,k),a,b),l(c),c)}catch(c){try{var p=\"function\"==typeof m?m:e;return p(c,a,b)}catch(a){return document.createTextNode(\"[\"+a+\"]\")}}},b.exports=g},{\"./jsonml-add-attributes\":12,\"./jsonml-append-child\":13,\"./jsonml-hydrate\":14,\"./jsonml-trim-whitespace\":16,\"./w3\":30}],16:[function(a,b,c){\"use strict\";function d(a){return a&&3===a.nodeType&&(!a.nodeValue||!/\\S/.exec(a.nodeValue))}function e(a){if(a){for(;d(a.firstChild);)a.removeChild(a.firstChild);for(;d(a.lastChild);)a.removeChild(a.lastChild)}}b.exports=e},{}],17:[function(a,b,c){\"use strict\";var d={xs:20,ys:20,xg:120,yh0:0,yh1:0,yf0:0,yf1:0,y0:5,yo:30,tgo:-10,ym:15,xlabel:6,xmax:1,scale:1,head:{},foot:{}};b.exports=d},{}],18:[function(a,b,c){\"use strict\";function d(a,b){function c(a){return a>0?Math.round(a):1}var d;b.hscale=1,b.hscale0&&(b.hscale=b.hscale0),a&&a.config&&a.config.hscale&&(d=Math.round(c(a.config.hscale)),d>0&&(d>100&&(d=100),b.hscale=d)),b.yh0=0,b.yh1=0,b.head=a.head,b.xmin_cfg=0,b.xmax_cfg=1e12,a&&a.config&&a.config.hbounds&&2==a.config.hbounds.length&&(a.config.hbounds[0]=Math.floor(a.config.hbounds[0]),a.config.hbounds[1]=Math.ceil(a.config.hbounds[1]),a.config.hbounds[0]<a.config.hbounds[1]&&(b.xmin_cfg=2*Math.floor(a.config.hbounds[0]),b.xmax_cfg=2*Math.floor(a.config.hbounds[1]))),a&&a.head&&((a.head.tick||0===a.head.tick||a.head.tock||0===a.head.tock)&&(b.yh0=20),(a.head.tick||0===a.head.tick)&&(a.head.tick=a.head.tick+b.xmin_cfg/2),(a.head.tock||0===a.head.tock)&&(a.head.tock=a.head.tock+b.xmin_cfg/2),a.head.text&&(b.yh1=46,b.head.text=a.head.text)),b.yf0=0,b.yf1=0,b.foot=a.foot,a&&a.foot&&((a.foot.tick||0===a.foot.tick||a.foot.tock||0===a.foot.tock)&&(b.yf0=20),(a.foot.tick||0===a.foot.tick)&&(a.foot.tick=a.foot.tick+b.xmin_cfg/2),(a.foot.tock||0===a.foot.tock)&&(a.foot.tock=a.foot.tock+b.xmin_cfg/2),a.foot.text&&(b.yf1=46,b.foot.text=a.foot.text))}b.exports=d},{}],19:[function(a,b,c){\"use strict\";function d(a,b,c){var d,h,i,j,k,l,m=[],n=[],o=[];for(m=a.split(\"\"),i=m.shift(),k=!1,d=1;\".\"===m[0]||\"|\"===m[0];)m.shift(),d+=1;for(n=n.concat(e(i,b,d));m.length;){for(h=i,i=m.shift(),\"<\"===i&&(k=!0,i=m.shift()),\">\"===i&&(k=!1,i=m.shift()),d=1;\".\"===m[0]||\"|\"===m[0];)m.shift(),d+=1;n=k?n.concat(f(h+i,0,d-c.period)):n.concat(f(h+i,b,d))}for(j=0;j<c.phase;j+=1)o.push(n.shift());return o.length>0?(l=g(o).length,1==g([o[o.length-1]]).length&&1==g([n[0]]).length&&(l-=1)):l=0,[n,l]}var e=a(\"./gen-first-wave-brick\"),f=a(\"./gen-wave-brick\"),g=a(\"./find-lane-markers\");b.exports=d},{\"./find-lane-markers\":5,\"./gen-first-wave-brick\":7,\"./gen-wave-brick\":8}],20:[function(a,b,c){\"use strict\";function d(a,b){var c;return c=a.data,void 0===c?null:(\"string\"==typeof c&&(c=c.split(\" \")),c=c.slice(b))}function e(a,b){var c,e,g,h,i,j=[],k=[];for(c in a)e=a[c],b.period=e.period?e.period:1,b.phase=(e.phase?2*e.phase:0)+b.xmin_cfg,j.push([]),k[0]=e.name||\" \",k[1]=(e.phase||0)+b.xmin_cfg/2,e.wave?(h=f(e.wave,b.period*b.hscale-1,b),g=h[0],i=h[1]):g=null,j[j.length-1][0]=k.slice(0),j[j.length-1][1]=g,j[j.length-1][2]=d(e,i);return j}var f=a(\"./parse-wave-lane\");b.exports=e},{\"./parse-wave-lane\":19}],21:[function(a,b,c){\"use strict\";function d(){var a,b,c,d;for(c=0,a=document.querySelectorAll(\"*\"),b=0;b<a.length;b++)a.item(b).type&&\"WaveDrom\"===a.item(b).type&&(a.item(b).setAttribute(\"id\",\"InputJSON_\"+c),d=document.createElement(\"div\"),d.id=\"WaveDrom_Display_\"+c,a.item(b).parentNode.insertBefore(d,a.item(b)),c+=1);for(b=0;b<c;b+=1)g(b,e(\"InputJSON_\"+b),\"WaveDrom_Display_\"),f(b,\"WaveDrom_Display_\");document.head.innerHTML+='<style type=\"text/css\">div.wavedromMenu{position:fixed;border:solid 1pt#CCCCCC;background-color:white;box-shadow:0px 10px 20px #808080;cursor:default;margin:0px;padding:0px;}div.wavedromMenu>ul{margin:0px;padding:0px;}div.wavedromMenu>ul>li{padding:2px 10px;list-style:none;}div.wavedromMenu>ul>li:hover{background-color:#b5d5ff;}</style>'}var e=a(\"./eva\"),f=a(\"./append-save-as-dialog\"),g=a(\"./render-wave-form\");b.exports=d},{\"./append-save-as-dialog\":1,\"./eva\":4,\"./render-wave-form\":28}],22:[function(a,b,c){\"use strict\";function d(a,b){var c,e,f={},g={x:10};for(\"string\"!=typeof a[0]&&\"number\"!=typeof a[0]||(e=a[0],g.x=25),b.x+=g.x,c=0;c<a.length;c++)\"object\"==typeof a[c]&&(\"[object Array]\"===Object.prototype.toString.call(a[c])?(f.y=b.y,b=d(a[c],b),b.groups.push({x:b.xx,y:f.y,height:b.y-f.y,name:b.name})):(b.lanes.push(a[c]),b.width.push(b.x),b.y+=1));return b.xx=b.x,b.x-=g.x,b.name=e,b}b.exports=d},{}],23:[function(a,b,c){\"use strict\";function d(a,b,c,d,h){function i(){r&&s&&(x=document.createElementNS(g.svg,\"path\"),x.id=\"gmark_\"+A.from+\"_\"+A.to,x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" \"+s.x+\",\"+s.y),x.setAttribute(\"style\",\"fill:none;stroke:#00F;stroke-width:1\"),j.insertBefore(x,null))}var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=[],A={words:[],from:0,shape:\"\",to:0,label:\"\"},B={};if(b){for(k in b)if(h.period=b[k].period?b[k].period:1,h.phase=(b[k].phase?2*b[k].phase:0)+h.xmin_cfg,m=b[k].node)for(z=m.split(\"\"),n=0;z.length;)o=z.shift(),\".\"!==o&&(B[o]={x:h.xs*(2*n*h.period*h.hscale-h.phase)+h.xlabel,y:k*h.yo+h.y0+.5*h.ys}),n+=1;if(j=document.createElementNS(g.svg,\"g\"),j.id=\"wavearcs_\"+c,a.insertBefore(j,null),d.edge)for(k in d.edge)if(A.words=d.edge[k].split(\" \"),A.label=d.edge[k].substring(A.words[0].length),A.label=A.label.substring(1),A.from=A.words[0].substr(0,1),A.to=A.words[0].substr(-1,1),A.shape=A.words[0].slice(1,-1),r=B[A.from],s=B[A.to],i(),r&&s){switch(A.label&&(p=e.parse(A.label),p.unshift(\"text\",{style:\"font-size:10px;\",\"text-anchor\":\"middle\",\"xml:space\":\"preserve\"}),p=f(p),q=f([\"rect\",{height:9,style:\"fill:#FFF;\"}]),j.insertBefore(q,null),j.insertBefore(p,null),y=p.getBBox().width,q.setAttribute(\"width\",y)),t=s.x-r.x,u=s.y-r.y,v=(r.x+s.x)/2,w=(r.y+s.y)/2,A.shape){case\"-\":break;case\"~\":x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u);break;case\"-~\":x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case\"~-\":x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c 0, 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.25*(s.x-r.x));break;case\"-|\":x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t+\",0 0,\"+u),A.label&&(v=s.x);break;case\"|-\":x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" 0,\"+u+\" \"+t+\",0\"),A.label&&(v=r.x);break;case\"-|-\":x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t/2+\",0 0,\"+u+\" \"+t/2+\",0\");break;case\"->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\");break;case\"~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u);break;case\"-~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case\"~->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c 0, 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.25*(s.x-r.x));break;case\"-|>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t+\",0 0,\"+u),A.label&&(v=s.x);break;case\"|->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" 0,\"+u+\" \"+t+\",0\"),A.label&&(v=r.x);break;case\"-|->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t/2+\",0 0,\"+u+\" \"+t/2+\",0\");break;case\"<->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\");break;case\"<~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u);break;case\"<-~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case\"<-|>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t+\",0 0,\"+u),A.label&&(v=s.x);break;case\"<-|->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t/2+\",0 0,\"+u+\" \"+t/2+\",0\");break;default:x.setAttribute(\"style\",\"fill:none;stroke:#F00;stroke-width:1\")}A.label&&(p.setAttribute(\"x\",v),p.setAttribute(\"y\",w+3),q.setAttribute(\"x\",v-y/2),q.setAttribute(\"y\",w-5))}for(l in B)l===l.toLowerCase()&&B[l].x>0&&(q=f([\"rect\",{y:B[l].y-4,height:8,style:\"fill:#FFF;\"}]),p=f([\"text\",{style:\"font-size:8px;\",x:B[l].x,y:B[l].y+2,\"text-anchor\":\"middle\"},l+\"\"]),j.insertBefore(q,null),j.insertBefore(p,null),y=p.getBBox().width+2,q.setAttribute(\"x\",B[l].x-y/2),q.setAttribute(\"width\",y))}}var e=a(\"tspan\"),f=a(\"./create-element\"),g=a(\"./w3\");b.exports=d},{\"./create-element\":2,\"./w3\":30,tspan:33}],24:[function(a,b,c){\"use strict\";function d(a,b){var c,e,f;for(b.xmax=Math.max(b.xmax,b.x),c=b.y,f=a.length,e=1;e<f;e++)\"[object Array]\"===Object.prototype.toString.call(a[e])?b=d(a[e],{x:b.x+1,y:b.y,xmax:b.xmax}):(a[e]={name:a[e],x:b.x+1,y:b.y},b.y+=2);return a[0]={name:a[0],x:b.x,y:Math.round((c+(b.y-2))/2)},b.x--,b}function e(a,b,c){var d,e,f=\" M 4,0 C 4,1.1 3.1,2 2,2 0.9,2 0,1.1 0,0 c 0,-1.1 0.9,-2 2,-2 1.1,0 2,0.9 2,2 z\",g={\"~\":\"M -11,-6 -11,6 0,0 z m -5,6 5,0\"+f,\"=\":\"M -11,-6 -11,6 0,0 z m -5,6 5,0\",\"&\":\"m -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z\",\"~&\":\"m -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z\"+f,\"|\":\"m -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z\",\"~|\":\"m -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z\"+f,\"^\":\"m -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z\",\"~^\":\"m -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z\"+f,\"+\":\"m -8,5 0,-10 m -5,5 10,0 m 3,0 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z\",\"*\":\"m -4,4 -8,-8 m 0,8 8,-8 m 4,4 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z\"},h={BUF:1,INV:1,AND:\"&\",NAND:\"&\",OR:\"â‰¥1\",NOR:\"â‰¥1\",XOR:\"=1\",XNOR:\"=1\",box:\"\"},i={INV:1,NAND:1,NOR:1,XNOR:1};return c===b&&(c=4,b=-4),d=g[a],e=h[a],d?[\"path\",{class:\"gate\",d:d}]:e?[\"g\",[\"path\",{class:\"gate\",d:\"m -16,\"+(b-3)+\" 16,0 0,\"+(c-b+6)+\" -16,0 z\"+(i[a]?f:\"\")}],[\"text\",[\"tspan\",{x:\"-14\",y:\"4\",class:\"wirename\"},e+\"\"]]]:[\"text\",[\"tspan\",{x:\"-14\",y:\"4\",class:\"wirename\"},a+\"\"]]}function f(a){var b,c,d,f=[\"g\"],g=[],h=a.length;for(b=2;b<h;b++)g.push(a[b][1]);for(c=Math.min.apply(null,g),d=Math.max.apply(null,g),f.push([\"g\",{transform:\"translate(16,0)\"},[\"path\",{d:\"M  \"+a[2][0]+\",\"+c+\" \"+a[2][0]+\",\"+d,class:\"wire\"}]]),b=2;b<h;b++)f.push([\"g\",[\"path\",{d:\"m  \"+a[b][0]+\",\"+a[b][1]+\" 16,0\",class:\"wire\"}]]);return f.push([\"g\",{transform:\"translate(\"+a[1][0]+\",\"+a[1][1]+\")\"},[\"title\",a[0]],e(a[0],c-a[1][1],d-a[1][1])]),f}function g(a,b){var c,d,e,h,i,j=[\"g\"],k=[];if(\"[object Array]\"===Object.prototype.toString.call(a)){for(d=a.length,k.push(a[0].name),k.push([32*(b-a[0].x),8*a[0].y]),c=1;c<d;c++)\"[object Array]\"===Object.prototype.toString.call(a[c])?k.push([32*(b-a[c][0].x),8*a[c][0].y]):k.push([32*(b-a[c].x),8*a[c].y]);for(j.push(f(k)),c=1;c<d;c++)j.push(g(a[c],b))}else i=a.name,e=32*(b-a.x),h=8*a.y,j.push([\"g\",{transform:\"translate(\"+e+\",\"+h+\")\"},[\"title\",i],[\"path\",{d:\"M 2,0 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z\"}],[\"text\",[\"tspan\",{x:\"-4\",y:\"4\",class:\"pinname\"},i]]]);return j}function h(a,b){var c,e,f,h,j,k,l,m,n,o,p=[\"g\"],q=[\"g\"];for(m=b.assign.length,e={x:0,y:2,xmax:0},c=b.assign,l=0;l<m;l++)e=d(c[l],e),e.x++;for(f=e.xmax+3,l=0;l<m;l++)p.push(g(c[l],f));for(j=32*(f+1)+1,k=8*(e.y+1)-7,m=4*(f+1),o=e.y+1,l=0;l<=m;l++)for(n=0;n<=o;n++)q.push([\"rect\",{height:1,width:1,x:8*l-.5,y:8*n-.5,class:\"grid\"}]);h=document.getElementById(\"svgcontent_\"+a),h.setAttribute(\"viewBox\",\"0 0 \"+j+\" \"+k),h.setAttribute(\"width\",j),h.setAttribute(\"height\",k),h.insertBefore(i([\"g\",{transform:\"translate(0.5, 0.5)\"},q,p]),null)}var i=a(\"./create-element\");b.exports=h},{\"./create-element\":2}],25:[function(a,b,c){\"use strict\";function d(a,b,c,d){var f,g,h,i,j,k,l,m,n=[];if(b){g=document.createElementNS(e.svg,\"g\"),g.id=\"wavegaps_\"+c,a.insertBefore(g,null),l=!1;for(f in b)if(d.period=b[f].period?b[f].period:1,d.phase=(b[f].phase?2*b[f].phase:0)+d.xmin_cfg,h=document.createElementNS(e.svg,\"g\"),h.id=\"wavegap_\"+f+\"_\"+c,h.setAttribute(\"transform\",\"translate(0,\"+(d.y0+f*d.yo)+\")\"),g.insertBefore(h,null),k=b[f].wave)for(n=k.split(\"\"),j=0;n.length;)m=n.shift(),\"<\"===m&&(l=!0,m=n.shift()),\">\"===m&&(l=!1,m=n.shift()),j+=l?1:2*d.period,\"|\"===m&&(i=document.createElementNS(e.svg,\"use\"),i.setAttributeNS(e.xlink,\"xlink:href\",\"#gap\"),i.setAttribute(\"transform\",\"translate(\"+d.xs*((j-(l?0:d.period))*d.hscale-d.phase)+\")\"),h.insertBefore(i,null))}}var e=a(\"./w3\");b.exports=d},{\"./w3\":30}],26:[function(a,b,c){\"use strict\";function d(a,b,c){var d,f,g,h=[\"g\"];return a.forEach(function(a,i){h.push([\"path\",{id:\"group_\"+i+\"_\"+b,d:\"m \"+(a.x+.5)+\",\"+(a.y*c.yo+3.5+c.yh0+c.yh1)+\" c -3,0 -5,2 -5,5 l 0,\"+(a.height*c.yo-16)+\" c 0,3 2,5 5,5\",style:\"stroke:#0041c4;stroke-width:1;fill:none\"}]),void 0!==a.name&&(d=a.x-10,f=c.yo*(a.y+a.height/2)+c.yh0+c.yh1,g=e.parse(a.name),g.unshift(\"text\",{\"text-anchor\":\"middle\",class:\"info\",\"xml:space\":\"preserve\"}),h.push([\"g\",{transform:\"translate(\"+d+\",\"+f+\")\"},[\"g\",{transform:\"rotate(270)\"},g]]))}),h}var e=a(\"tspan\");b.exports=d},{tspan:33}],27:[function(a,b,c){\"use strict\";function d(a,b,c,d){function g(a,b,c){var d;a[b]&&a[b].text&&(d=e.parse(a[b].text),d.unshift(\"text\",{x:a.xmax*a.xs/2,y:c,\"text-anchor\":\"middle\",fill:\"#000\",\"xml:space\":\"preserve\"}),d=f(d),j.insertBefore(d,null))}function h(a,b,c,d,g,h,k){var l,m,n,o,p=1,q=0,r=[];if(void 0!==a[b]&&void 0!==a[b][c]){if(n=a[b][c],\"string\"==typeof n)n=n.split(\" \");else if(\"number\"==typeof n||\"boolean\"==typeof n)for(m=Number(n),n=[],i=0;i<k;i+=1)n.push(i+m);if(\"[object Array]\"===Object.prototype.toString.call(n)&&0!==n.length){if(1===n.length)if(m=Number(n[0]),isNaN(m))r=n;else for(i=0;i<k;i+=1)r[i]=i+m;else if(2===n.length)if(m=Number(n[0]),p=Number(n[1]),o=n[1].split(\".\"),2===o.length&&(q=o[1].length),isNaN(m)||isNaN(p))r=n;else for(m=p*m,i=0;i<k;i+=1)r[i]=(p*i+m).toFixed(q);else r=n;for(i=0;i<k;i+=1)o=r[i],l=e.parse(o),l.unshift(\"text\",{x:i*g+d,y:h,\"text-anchor\":\"middle\",class:\"muted\",\"xml:space\":\"preserve\"}),l=f(l),j.insertBefore(l,null)}}}var i,j,k,l,m,n;for(l=2*d.hscale,m=l*d.xs,k=d.xmax/l,n=b.length*d.yo,j=f([\"g\",{id:\"gmarks_\"+c}]),a.insertBefore(j,a.firstChild),i=0;i<k+1;i+=1)j.insertBefore(f([\"path\",{id:\"gmark_\"+i+\"_\"+c,d:\"m \"+i*m+\",0 0,\"+n,style:\"stroke:#888;stroke-width:0.5;stroke-dasharray:1,3\"}]),null);g(d,\"head\",d.yh0?-33:-13),g(d,\"foot\",n+(d.yf0?45:25)),h(d,\"head\",\"tick\",0,m,-5,k+1),h(d,\"head\",\"tock\",m/2,m,-5,k),h(d,\"foot\",\"tick\",0,m,n+15,k+1),h(d,\"foot\",\"tock\",m/2,m,n+15,k)}var e=a(\"tspan\"),f=a(\"./create-element\");b.exports=d},{\"./create-element\":2,tspan:33}],28:[function(a,b,c){\"use strict\";function d(a,b,c){var d,r,s,t,u,v,w,x,y,z=0;if(b.signal){p(a,document.getElementById(c+a),b,f),h(b,f),d=e(b.signal,{x:0,y:0,xmax:0,width:[],lanes:[],groups:[]}),r=document.getElementById(\"lanes_\"+a),s=document.getElementById(\"groups_\"+a),u=i(d.lanes,f),x=m(r,u,a,f);for(y in x)z=Math.max(z,x[y]+d.width[y]);j(r,u,a,f),o(r,d.lanes,a,b,f),k(r,d.lanes,a,f),s.insertBefore(g(l(d.groups,a,f)),null),f.xg=Math.ceil((z-f.tgo)/f.xs)*f.xs,v=f.xg+f.xs*(f.xmax+1),w=u.length*f.yo+f.yh0+f.yh1+f.yf0+f.yf1,t=document.getElementById(\"svgcontent_\"+a),t.setAttribute(\"viewBox\",\"0 0 \"+v+\" \"+w),t.setAttribute(\"width\",v),t.setAttribute(\"height\",w),t.setAttribute(\"overflow\",\"hidden\"),r.setAttribute(\"transform\",\"translate(\"+(f.xg+.5)+\", \"+(f.yh0+f.yh1+.5)+\")\")}else b.assign&&(q(a,document.getElementById(c+a),b),n(a,b))}var e=a(\"./rec\"),f=a(\"./lane\"),g=a(\"./create-element\"),h=a(\"./parse-config\"),i=a(\"./parse-wave-lanes\"),j=a(\"./render-marks\"),k=a(\"./render-gaps\"),l=a(\"./render-groups\"),m=a(\"./render-wave-lane\"),n=a(\"./render-assign\"),o=a(\"./render-arcs\"),p=a(\"./insert-svg-template\"),q=a(\"./insert-svg-template-assign\");b.exports=d},{\"./create-element\":2,\"./insert-svg-template\":11,\"./insert-svg-template-assign\":10,\"./lane\":17,\"./parse-config\":18,\"./parse-wave-lanes\":20,\"./rec\":22,\"./render-arcs\":23,\"./render-assign\":24,\"./render-gaps\":25,\"./render-groups\":26,\"./render-marks\":27,\"./render-wave-lane\":29}],29:[function(a,b,c){\"use strict\";function d(a,b,c,d){var i,j,k,l,m,n,o,p,q,r=[1],s=0,t=0,u=[];for(j=0;j<b.length;j+=1)if(p=b[j][0][0],p&&(l=f([\"g\",{id:\"wavelane_\"+j+\"_\"+c,transform:\"translate(0,\"+(d.y0+j*d.yo)+\")\"}]),a.insertBefore(l,null),n=e.parse(p),n.unshift(\"text\",{x:d.tgo,y:d.ym,class:\"info\",\"text-anchor\":\"end\",\"xml:space\":\"preserve\"}),n=f(n),l.insertBefore(n,null),u.push(n.getBBox().width),q=b[j][0][1],q=q>0?Math.ceil(2*q)-2*q:-2*q,m=f([\"g\",{id:\"wavelane_draw_\"+j+\"_\"+c,transform:\"translate(\"+q*d.xs+\", 0)\"}]),l.insertBefore(m,null),b[j][1])){for(i=0;i<b[j][1].length;i+=1)o=document.createElementNS(g.svg,\"use\"),o.setAttributeNS(g.xlink,\"xlink:href\",\"#\"+b[j][1][i]),o.setAttribute(\"transform\",\"translate(\"+i*d.xs+\")\"),m.insertBefore(o,null);if(b[j][2]&&b[j][2].length&&(r=h(b[j][1]),0!==r.length))for(k in r)b[j][2]&&\"undefined\"!=typeof b[j][2][k]&&(n=e.parse(b[j][2][k]),n.unshift(\"text\",{x:r[k]*d.xs+d.xlabel,y:d.ym,\"text-anchor\":\"middle\",\"xml:space\":\"preserve\"}),n=f(n),m.insertBefore(n,null));b[j][1].length>s&&(s=b[j][1].length)}return d.xmax=Math.min(s,d.xmax_cfg-d.xmin_cfg),d.xg=t+20,u}var e=a(\"tspan\"),f=a(\"./create-element\"),g=a(\"./w3\"),h=a(\"./find-lane-markers\");b.exports=d},{\"./create-element\":2,\"./find-lane-markers\":5,\"./w3\":30,tspan:33}],30:[function(a,b,c){\"use strict\";b.exports={svg:\"http://www.w3.org/2000/svg\",xlink:\"http://www.w3.org/1999/xlink\",xmlns:\"http://www.w3.org/XML/1998/namespace\"}},{}],31:[function(a,b,c){\"use strict\";window.WaveDrom=window.WaveDrom||{};var d=a(\"./\");window.WaveDrom.ProcessAll=d.processAll,window.WaveDrom.RenderWaveForm=d.renderWaveForm,window.WaveDrom.EditorRefresh=d.editorRefresh,window.WaveDrom.eva=d.eva},{\"./\":9}],32:[function(a,b,c){\"use strict\";b.exports=window.WaveSkin},{}],33:[function(a,b,c){\"use strict\";function d(a,b){b.add&&b.add.split(\";\").forEach(function(b){var c=b.split(\" \");a[c[0]][c[1]]=!0}),b.del&&b.del.split(\";\").forEach(function(b){var c=b.split(\" \");delete a[c[0]][c[1]]})}function e(a){return Object.keys(a).reduce(function(b,c){var d=Object.keys(a[c]);return d.length>0&&(b[c]=d.join(\" \")),b},{})}function f(a){var b,c,f,i,j;if(void 0===a)return[];if(\"number\"==typeof a)return[a+\"\"];if(\"string\"!=typeof a)return[a];for(c=[],b={\"text-decoration\":{},\"font-weight\":{},\"font-style\":{},\"baseline-shift\":{},\"font-size\":{},\"font-family\":{}};;){if(f=a.search(g),f===-1)return c.push([\"tspan\",e(b),a]),c;if(f>0&&(j=a.slice(0,f),c.push([\"tspan\",e(b),j])),i=a.match(g)[0],d(b,h[i]),a=a.slice(f+i.length),0===a.length)return c}}var g=/<o>|<ins>|<s>|<sub>|<sup>|<b>|<i>|<tt>|<\\/o>|<\\/ins>|<\\/s>|<\\/sub>|<\\/sup>|<\\/b>|<\\/i>|<\\/tt>/,h={\"<o>\":{add:\"text-decoration overline\"},\"</o>\":{del:\"text-decoration overline\"},\"<ins>\":{add:\"text-decoration underline\"},\"</ins>\":{del:\"text-decoration underline\"},\"<s>\":{add:\"text-decoration line-through\"},\"</s>\":{del:\"text-decoration line-through\"},\"<b>\":{add:\"font-weight bold\"},\"</b>\":{del:\"font-weight bold\"},\"<i>\":{add:\"font-style italic\"},\"</i>\":{del:\"font-style italic\"},\"<sub>\":{add:\"baseline-shift sub;font-size .7em\"},\"</sub>\":{del:\"baseline-shift sub;font-size .7em\"},\"<sup>\":{add:\"baseline-shift super;font-size .7em\"},\"</sup>\":{del:\"baseline-shift super;font-size .7em\"},\"<tt>\":{add:\"font-family monospace\"},\"</tt>\":{del:\"font-family monospace\"}};c.parse=f},{}]},{},[31]);</script><div><script type=\"WaveDrom\">{\"signal\": [{\"name\": \"clk\", \"wave\": \"P....................x\"}, {\"name\": \"/HWSystem[HWSystem][inc]\", \"wave\": \"x0..10.10.10.10.10.10x\", \"data\": []}, {\"name\": \"/HWSystem[HWSystem][q0]\", \"wave\": \"x2...2..2..2..2..2..2x\", \"data\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]}, {\"name\": \"/HWSystem[HWSystem][q1]\", \"wave\": \"x2...2..2..2..2..2..2x\", \"data\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]}], \"head\": {\"text\": \"wvf\", \"tock\": 0}}</script></div><script>WaveDrom.ProcessAll();</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys = py4hw.HWSystem()\n",
    "\n",
    "inc = py4hw.Wire(sys, 'inc', 1)\n",
    "q0 = py4hw.Wire(sys, 'q0', 8)\n",
    "q1 = py4hw.Wire(sys, 'q1', 8)\n",
    "\n",
    "py4hw.Sequence(sys, 'inc', [0, 0, 1], inc)\n",
    "\n",
    "count0 = Counter(sys, 'counter_structural', inc, q0)\n",
    "count1 = CounterRTL(sys, 'counter_rtl', inc, q1)\n",
    "\n",
    "print('circuit created')\n",
    "\n",
    "wvf = py4hw.Waveform(sys, 'wvf', [inc,q0,q1])\n",
    "\n",
    "sys.getSimulator().clk(20)\n",
    "wvf.draw_wavedrom()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What about the Verilog implementation ?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "// This file was automatically created by py4hw RTL generator\n",
      "module Counter (\n",
      "\tinput clk50,\n",
      "\tinput  inc,\n",
      "\toutput [7:0] q);\n",
      "wire [7:0] w_count;\n",
      "\n",
      "assign w_count = q + inc;\n",
      "Reg8E i_reg(.clk50(clk50),.d(w_count),.e(inc),.q(q));\n",
      "endmodule\n",
      "\n",
      "// This file was automatically created by py4hw RTL generator\n",
      "module Reg8E (\n",
      "\tinput clk50,\n",
      "\tinput [7:0] d,\n",
      "\tinput  e,\n",
      "\toutput [7:0] q);\n",
      "reg [7:0] rq = 0;\n",
      "always @(posedge clk50)\n",
      "if (e == 1)\n",
      "begin\n",
      "   rq <= d;\n",
      "end\n",
      "assign q = rq;\n",
      "endmodule\n",
      "\n"
     ]
    }
   ],
   "source": [
    "rtl = py4hw.VerilogGenerator(count0)\n",
    "\n",
    "print(rtl.getVerilogForHierarchy())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "// This file was automatically created by py4hw RTL generator\n",
      "module CounterRTL (\n",
      "\tinput clk50,\n",
      "\tinput  inc,\n",
      "\toutput  reg [7:0] q);\n",
      "// Code generated from clock method\n",
      "// wire/variable declaration\n",
      "// initial\n",
      "initial\n",
      "begin\n",
      "end\n",
      "// process\n",
      "always @(posedge clk50)\n",
      "begin\n",
      "    if (inc==1)\n",
      "    begin\n",
      "        q<=q+1;\n",
      "    end\n",
      "end\n",
      "endmodule\n",
      "\n"
     ]
    }
   ],
   "source": [
    "rtl = py4hw.VerilogGenerator(count1)\n",
    "\n",
    "print(rtl.getVerilogForHierarchy())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Sequential Design Style\n",
    "A more common design style for Software programmers are sequential programs defined by procedural programming languages.\n",
    "\n",
    "In this case, we use sequential cirtuits (implementing the clock method) with python coroutines.\n",
    "\n",
    "The sequential algorithm is described in the **run** method, and everything that is executed between two invocations of the **yield** statement happen in during the same clock cycle.\n",
    "\n",
    "We currently do not support Hardware synthesis from this design style, but it is very powerful for simulation.\n",
    "You can use **yield from** to implement functions, increasing the complexity of the simulation stimuli.\n",
    "\n",
    "The example below is the same circuit expressed in a Sequential design style."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "class CounterSeq(py4hw.Logic):\n",
    "    def __init__(self, parent, name, inc, q):\n",
    "        super().__init__(parent, name)\n",
    "    \n",
    "        self.inc = self.addIn('inc', inc)\n",
    "        self.q = self.addOut('q', q)\n",
    "        \n",
    "        self.vinc = 0\n",
    "        self.vq = 0\n",
    "        \n",
    "        self.co = self.run()\n",
    "        \n",
    "    def clock(self):\n",
    "        self.vinc = inc.get()\n",
    "        next(self.co)\n",
    "        self.q.prepare(self.vq)\n",
    "        \n",
    "    def run(self):\n",
    "        while(True):\n",
    "            if (self.vinc):\n",
    "                self.vq += 1\n",
    "                yield"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can easily verify that the behaviour of all 3 circuits described with different design styles is the same."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "circuit created\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<script>var WaveSkin=WaveSkin||{};WaveSkin.default=[\"svg\",{\"id\":\"svg\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"height\":\"0\"},[\"style\",{\"type\":\"text/css\"},\"text{font-size:11pt;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;fill-opacity:1;font-family:Helvetica}.muted{fill:#aaa}.warning{fill:#f6b900}.error{fill:#f60000}.info{fill:#0041c4}.success{fill:#00ab00}.h1{font-size:33pt;font-weight:bold}.h2{font-size:27pt;font-weight:bold}.h3{font-size:20pt;font-weight:bold}.h4{font-size:14pt;font-weight:bold}.h5{font-size:11pt;font-weight:bold}.h6{font-size:8pt;font-weight:bold}.s1{fill:none;stroke:#000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none}.s2{fill:none;stroke:#000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none}.s3{color:#000;fill:none;stroke:#000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 3;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s4{color:#000;fill:none;stroke:#000;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible}.s5{fill:#fff;stroke:none}.s6{color:#000;fill:#ffffb4;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s7{color:#000;fill:#ffe0b9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s8{color:#000;fill:#b9e0ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s9{fill:#000;fill-opacity:1;stroke:none}.s10{color:#000;fill:#fff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate}.s11{fill:#0041c4;fill-opacity:1;stroke:none}.s12{fill:none;stroke:#0041c4;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none}\"],[\"defs\",[\"g\",{\"id\":\"socket\"},[\"rect\",{\"y\":\"15\",\"x\":\"6\",\"height\":\"20\",\"width\":\"20\"}]],[\"g\",{\"id\":\"pclk\"},[\"path\",{\"d\":\"M0,20 0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"nclk\"},[\"path\",{\"d\":\"m0,0 0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"000\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0m0\"},[\"path\",{\"d\":\"m0,20 3,0 3,-10 3,10 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0m1\"},[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mx\"},[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 5,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 4,16\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0md\"},[\"path\",{\"d\":\"m8,20 10,0\",\"class\":\"s3\"}],[\"path\",{\"d\":\"m0,20 5,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mu\"},[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10.107603,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mz\"},[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"111\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1m0\"},[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1m1\"},[\"path\",{\"d\":\"M0,0 3,0 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mx\"},[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M3.5,1.5 5,0\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"1md\"},[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mu\"},[\"path\",{\"d\":\"M0,0 5,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M8,0 18,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"1mz\"},[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xxx\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 10,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 15,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 20,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M5,20 20,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,20 20,10\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m15,20 5,-5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xm0\"},[\"path\",{\"d\":\"M0,0 4,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 4,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M5,20 8,17\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xm1\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 4,20 9,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 9,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 5,15\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmx\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 10,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 15,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 20,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M5,20 20,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,20 20,10\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m15,20 5,-5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmd\"},[\"path\",{\"d\":\"m0,0 4,0 c 3,10 6,20 16,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 4,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 5.5,4.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6.5,8.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 8,12\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m5,20 5,-5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m10,20 2.5,-2.5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmu\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 4,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 5,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 10,0\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 10,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 6,14\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"xmz\"},[\"path\",{\"d\":\"m0,0 4,0 c 6,10 11,10 16,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 4,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 4.5,0.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 6.5,3.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 8.5,6.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 11.5,8.5\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"ddd\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"dm0\"},[\"path\",{\"d\":\"m0,20 10,0\",\"class\":\"s3\"}],[\"path\",{\"d\":\"m12,20 8,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dm1\"},[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dmx\"},[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 5,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 4,16\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dmd\"},[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"dmu\"},[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10.107603,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"dmz\"},[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"uuu\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"um0\"},[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"um1\"},[\"path\",{\"d\":\"M0,0 10,0\",\"class\":\"s3\"}],[\"path\",{\"d\":\"m12,0 8,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umx\"},[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M3.5,1.5 5,0\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"umd\"},[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umu\"},[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s3\"}]],[\"g\",{\"id\":\"umz\"},[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s4\"}]],[\"g\",{\"id\":\"zzz\"},[\"path\",{\"d\":\"m0,10 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zm0\"},[\"path\",{\"d\":\"m0,10 6,0 3,10 11,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zm1\"},[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmx\"},[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 6.5,8.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"zmd\"},[\"path\",{\"d\":\"m0,10 7,0 c 3,5 8,10 13,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmu\"},[\"path\",{\"d\":\"m0,10 7,0 C 10,5 15,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmz\"},[\"path\",{\"d\":\"m0,10 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"gap\"},[\"path\",{\"d\":\"m7,-2 -4,0 c -5,0 -5,24 -10,24 l 4,0 C 2,22 2,-2 7,-2 z\",\"class\":\"s5\"}],[\"path\",{\"d\":\"M-7,22 C -2,22 -2,-2 3,-2\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M-3,22 C 2,22 2,-2 7,-2\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-3\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-3\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-3\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-3\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-3\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-3\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-3\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-3\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-3\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-4\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-4\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-5\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-5\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-4\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-4\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-4\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-4\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-4\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-4\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-4\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-5\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-5\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-5\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-5\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-5\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-5\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-5\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"Pclk\"},[\"path\",{\"d\":\"M-3,12 0,3 3,12 C 1,11 -1,11 -3,12 z\",\"class\":\"s9\"}],[\"path\",{\"d\":\"M0,20 0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"Nclk\"},[\"path\",{\"d\":\"M-3,8 0,17 3,8 C 1,9 -1,9 -3,8 z\",\"class\":\"s9\"}],[\"path\",{\"d\":\"m0,0 0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vvv-2\"},[\"path\",{\"d\":\"M20,20 0,20 0,0 20,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm0-2\"},[\"path\",{\"d\":\"M0,20 0,0 3,0 9,20\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M0,0 3,0 9,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vm1-2\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 9,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmx-2\"},[\"path\",{\"d\":\"M0,0 0,20 3,20 6,10 3,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m20,15 -5,5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,10 10,20\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,5 8,17\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M20,0 7,13\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M15,0 7,8\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M10,0 9,1\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"vmd-2\"},[\"path\",{\"d\":\"m0,0 0,20 20,0 C 10,20 7,10 3,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 c 4,10 7,20 17,20\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmu-2\"},[\"path\",{\"d\":\"m0,0 0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,20 3,0 C 7,10 10,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmz-2\"},[\"path\",{\"d\":\"M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 c 7,10 12,10 17,10\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 3,0 C 10,10 15,10 20,10\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"0mv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"1mv-2\"},[\"path\",{\"d\":\"M2.875,0 20,0 20,20 9,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"xmv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,5 3.5,1.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,10 4.5,5.5\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,15 6,9\",\"class\":\"s2\"}],[\"path\",{\"d\":\"M0,20 4,16\",\"class\":\"s2\"}]],[\"g\",{\"id\":\"dmv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 3,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,20 9,0 20,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"m0,20 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"umv-2\"},[\"path\",{\"d\":\"M3,0 20,0 20,20 9,20 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"zmv-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m6,10 3,10 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,10 6,10 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-3-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-4-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-5-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-3\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s6\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-4\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s7\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-5\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s8\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"vmv-2-2\"},[\"path\",{\"d\":\"M9,0 20,0 20,20 9,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"M3,0 0,0 0,20 3,20 6,10 z\",\"class\":\"s10\"}],[\"path\",{\"d\":\"m0,0 3,0 6,20 11,0\",\"class\":\"s1\"}],[\"path\",{\"d\":\"M0,20 3,20 9,0 20,0\",\"class\":\"s1\"}]],[\"g\",{\"id\":\"arrow0\"},[\"path\",{\"d\":\"m-12,-3 9,3 -9,3 c 1,-2 1,-4 0,-6 z\",\"class\":\"s11\"}],[\"path\",{\"d\":\"M0,0 -15,0\",\"class\":\"s12\"}]],[\"marker\",{\"id\":\"arrowhead\",\"style\":\"fill:#0041c4\",\"markerHeight\":\"7\",\"markerWidth\":\"10\",\"markerUnits\":\"strokeWidth\",\"viewBox\":\"0 -4 11 8\",\"refX\":\"15\",\"refY\":\"0\",\"orient\":\"auto\"},[\"path\",{\"d\":\"M0 -4 11 0 0 4z\"}]],[\"marker\",{\"id\":\"arrowtail\",\"style\":\"fill:#0041c4\",\"markerHeight\":\"7\",\"markerWidth\":\"10\",\"markerUnits\":\"strokeWidth\",\"viewBox\":\"-11 -4 11 8\",\"refX\":\"-15\",\"refY\":\"0\",\"orient\":\"auto\"},[\"path\",{\"d\":\"M0 -4 -11 0 0 4z\"}]]],[\"g\",{\"id\":\"waves\"},[\"g\",{\"id\":\"lanes\"}],[\"g\",{\"id\":\"groups\"}]]];\n",
       "</script><script>/*! wavedrom 2016-07-28 */\n",
       "!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i=\"function\"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error(\"Cannot find module '\"+g+\"'\");throw j.code=\"MODULE_NOT_FOUND\",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f=\"function\"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){\"use strict\";function d(a,b){function c(a){var b=parseInt(e.style.left,10),d=parseInt(e.style.top,10);(a.x<b||a.x>b+e.offsetWidth||a.y<d||a.y>d+e.offsetHeight)&&(e.parentNode.removeChild(e),document.body.removeEventListener(\"mousedown\",c,!1))}var d,e;d=document.getElementById(b+a),d.childNodes[0].addEventListener(\"contextmenu\",function(f){var g,h,i;e=document.createElement(\"div\"),e.className=\"wavedromMenu\",e.style.top=f.y+\"px\",e.style.left=f.x+\"px\",g=document.createElement(\"ul\"),h=document.createElement(\"li\"),h.innerHTML=\"Save as PNG\",g.appendChild(h),i=document.createElement(\"li\"),i.innerHTML=\"Save as SVG\",g.appendChild(i),e.appendChild(g),document.body.appendChild(e),h.addEventListener(\"click\",function(){var f,g,h,i,j,k,l,m;f=\"\",0!==a&&(g=document.getElementById(b+0),f+=g.innerHTML.substring(166,g.innerHTML.indexOf('<g id=\"waves_0\">'))),f=[d.innerHTML.slice(0,166),f,d.innerHTML.slice(166)].join(\"\"),h=\"data:image/svg+xml;base64,\"+btoa(f),i=new Image,i.src=h,j=document.createElement(\"canvas\"),j.width=i.width,j.height=i.height,k=j.getContext(\"2d\"),k.drawImage(i,0,0),l=j.toDataURL(\"image/png\"),m=document.createElement(\"a\"),m.href=l,m.download=\"wavedrom.png\",m.click(),e.parentNode.removeChild(e),document.body.removeEventListener(\"mousedown\",c,!1)},!1),i.addEventListener(\"click\",function(){var f,g,h,i;f=\"\",0!==a&&(g=document.getElementById(b+0),f+=g.innerHTML.substring(166,g.innerHTML.indexOf('<g id=\"waves_0\">'))),f=[d.innerHTML.slice(0,166),f,d.innerHTML.slice(166)].join(\"\"),h=\"data:image/svg+xml;base64,\"+btoa(f),i=document.createElement(\"a\"),i.href=h,i.download=\"wavedrom.svg\",i.click(),e.parentNode.removeChild(e),document.body.removeEventListener(\"mousedown\",c,!1)},!1),e.addEventListener(\"contextmenu\",function(a){a.preventDefault()},!1),document.body.addEventListener(\"mousedown\",c,!1),f.preventDefault()},!1)}b.exports=d},{}],2:[function(a,b,c){\"use strict\";var d=a(\"./jsonml-parse\");b.exports=d},{\"./jsonml-parse\":15}],3:[function(a,b,c){\"use strict\";function d(){f(0,e(\"InputJSON_0\"),\"WaveDrom_Display_\")}var e=a(\"./eva\"),f=a(\"./render-wave-form\");b.exports=d},{\"./eva\":4,\"./render-wave-form\":28}],4:[function(require,module,exports){\"use strict\";function eva(id){function erra(a){return{signal:[{name:[\"tspan\",[\"tspan\",{class:\"error h5\"},\"Error: \"],a.message]}]}}var TheTextBox,source;if(TheTextBox=document.getElementById(id),TheTextBox.type&&\"textarea\"===TheTextBox.type)try{source=eval(\"(\"+TheTextBox.value+\")\")}catch(a){return erra(a)}else try{source=eval(\"(\"+TheTextBox.innerHTML+\")\")}catch(a){return erra(a)}if(\"[object Object]\"!==Object.prototype.toString.call(source))return erra({message:'[Semantic]: The root has to be an Object: \"{signal:[...]}\"'});if(source.signal){if(\"[object Array]\"!==Object.prototype.toString.call(source.signal))return erra({message:'[Semantic]: \"signal\" object has to be an Array \"signal:[]\"'})}else{if(!source.assign)return erra({message:'[Semantic]: \"signal:[...]\" or \"assign:[...]\" property is missing inside the root Object'});if(\"[object Array]\"!==Object.prototype.toString.call(source.assign))return erra({message:'[Semantic]: \"assign\" object hasto be an Array \"assign:[]\"'})}return source}module.exports=eva},{}],5:[function(a,b,c){\"use strict\";function d(a){var b=0,c=0,d=[];return a.forEach(function(a){\"vvv-2\"===a||\"vvv-3\"===a||\"vvv-4\"===a||\"vvv-5\"===a?c+=1:0!==c&&(d.push(b-(c+1)/2),c=0),b+=1}),0!==c&&d.push(b-(c+1)/2),d}b.exports=d},{}],6:[function(a,b,c){\"use strict\";function d(a,b,c){var d,e,f=[];if(4===a.length){for(e=0;e<c;e+=1){for(f.push(a[0]),d=0;d<b;d+=1)f.push(a[1]);for(f.push(a[2]),d=0;d<b;d+=1)f.push(a[3])}return f}for(1===a.length&&a.push(a[0]),f.push(a[0]),d=0;d<c*(2*(b+1))-1;d+=1)f.push(a[1]);return f}b.exports=d},{}],7:[function(a,b,c){\"use strict\";function d(a,b,c){var d;switch(d=[],a){case\"p\":d=e([\"pclk\",\"111\",\"nclk\",\"000\"],b,c);break;case\"n\":d=e([\"nclk\",\"000\",\"pclk\",\"111\"],b,c);break;case\"P\":d=e([\"Pclk\",\"111\",\"nclk\",\"000\"],b,c);break;case\"N\":d=e([\"Nclk\",\"000\",\"pclk\",\"111\"],b,c);break;case\"l\":case\"L\":case\"0\":d=e([\"000\"],b,c);break;case\"h\":case\"H\":case\"1\":d=e([\"111\"],b,c);break;case\"=\":d=e([\"vvv-2\"],b,c);break;case\"2\":d=e([\"vvv-2\"],b,c);break;case\"3\":d=e([\"vvv-3\"],b,c);break;case\"4\":d=e([\"vvv-4\"],b,c);break;case\"5\":d=e([\"vvv-5\"],b,c);break;case\"d\":d=e([\"ddd\"],b,c);break;case\"u\":d=e([\"uuu\"],b,c);break;case\"z\":d=e([\"zzz\"],b,c);break;default:d=e([\"xxx\"],b,c)}return d}var e=a(\"./gen-brick\");b.exports=d},{\"./gen-brick\":6}],8:[function(a,b,c){\"use strict\";function d(a,b,c){var d,f,g,h,i,j,k,l,m,n,o,p,q,r,s;return d={p:\"pclk\",n:\"nclk\",P:\"Pclk\",N:\"Nclk\",h:\"pclk\",l:\"nclk\",H:\"Pclk\",L:\"Nclk\"},f={0:\"0\",1:\"1\",x:\"x\",d:\"d\",u:\"u\",z:\"z\",\"=\":\"v\",2:\"v\",3:\"v\",4:\"v\",5:\"v\"},g={0:\"\",1:\"\",x:\"\",d:\"\",u:\"\",z:\"\",\"=\":\"-2\",2:\"-2\",3:\"-3\",4:\"-4\",5:\"-5\"},h={p:\"0\",n:\"1\",P:\"0\",N:\"1\",h:\"1\",l:\"0\",H:\"1\",L:\"0\",0:\"0\",1:\"1\",x:\"x\",d:\"d\",u:\"u\",z:\"z\",\"=\":\"v\",2:\"v\",3:\"v\",4:\"v\",5:\"v\"},i={p:\"\",n:\"\",P:\"\",N:\"\",h:\"\",l:\"\",H:\"\",L:\"\",0:\"\",1:\"\",x:\"\",d:\"\",u:\"\",z:\"\",\"=\":\"-2\",2:\"-2\",3:\"-3\",4:\"-4\",5:\"-5\"},j={p:\"111\",n:\"000\",P:\"111\",N:\"000\",h:\"111\",l:\"000\",H:\"111\",L:\"000\",0:\"000\",1:\"111\",x:\"xxx\",d:\"ddd\",u:\"uuu\",z:\"zzz\",\"=\":\"vvv-2\",2:\"vvv-2\",3:\"vvv-3\",4:\"vvv-4\",5:\"vvv-5\"},k={p:\"nclk\",n:\"pclk\",P:\"nclk\",N:\"pclk\"},l={p:\"000\",n:\"111\",P:\"000\",N:\"111\"},m={hp:\"111\",Hp:\"111\",ln:\"000\",Ln:\"000\",nh:\"111\",Nh:\"111\",pl:\"000\",Pl:\"000\"},n=a.split(\"\"),o=j[n[1]],p=d[n[1]],void 0===p?(q=f[n[1]],void 0===q?e([\"xxx\"],b,c):(r=h[n[0]],void 0===r?e([\"xxx\"],b,c):e([r+\"m\"+q+i[n[0]]+g[n[1]],o],b,c))):(s=m[a],void 0!==s&&(p=s),q=k[n[1]],void 0===q?e([p,o],b,c):e([p,o,q,l[n[1]]],b,c))}var e=a(\"./gen-brick\");b.exports=d},{\"./gen-brick\":6}],9:[function(a,b,c){\"use strict\";var d=a(\"./process-all\"),e=a(\"./eva\"),f=a(\"./render-wave-form\"),g=a(\"./editor-refresh\");b.exports={processAll:d,eva:e,renderWaveForm:f,editorRefresh:g}},{\"./editor-refresh\":3,\"./eva\":4,\"./process-all\":21,\"./render-wave-form\":28}],10:[function(a,b,c){\"use strict\";function d(a,b){for(var c,d;b.childNodes.length;)b.removeChild(b.childNodes[0]);d=[\"svg\",{id:\"svgcontent_\"+a,xmlns:f.svg,\"xmlns:xlink\":f.xlink,overflow:\"hidden\"},[\"style\",\".pinname {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:end; font-family:Helvetica} .wirename {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:start; font-family:Helvetica} .wirename:hover {fill:blue} .gate {color:#000; fill:#ffc; fill-opacity: 1;stroke:#000; stroke-width:1; stroke-opacity:1} .gate:hover {fill:red !important; } .wire {fill:none; stroke:#000; stroke-width:1; stroke-opacity:1} .grid {fill:#fff; fill-opacity:1; stroke:none}\"]],c=e(d),b.insertBefore(c,null)}var e=a(\"./create-element\"),f=a(\"./w3\");b.exports=d},{\"./create-element\":2,\"./w3\":30}],11:[function(a,b,c){\"use strict\";function d(a,b,c,d){for(var h,i,j;b.childNodes.length;)b.removeChild(b.childNodes[0]);for(i in g)break;j=g.default||g[i],c&&c.config&&c.config.skin&&g[c.config.skin]&&(j=g[c.config.skin]),0===a?(d.xs=Number(j[3][1][2][1].width),d.ys=Number(j[3][1][2][1].height),d.xlabel=Number(j[3][1][2][1].x),d.ym=Number(j[3][1][2][1].y)):j=[\"svg\",{id:\"svg\",xmlns:f.svg,\"xmlns:xlink\":f.xlink,height:\"0\"},[\"g\",{id:\"waves\"},[\"g\",{id:\"lanes\"}],[\"g\",{id:\"groups\"}]]],j[j.length-1][1].id=\"waves_\"+a,j[j.length-1][2][1].id=\"lanes_\"+a,j[j.length-1][3][1].id=\"groups_\"+a,j[1].id=\"svgcontent_\"+a,j[1].height=0,h=e(j),b.insertBefore(h,null)}var e=a(\"./create-element\"),f=a(\"./w3\"),g=a(\"./wave-skin\");b.exports=d},{\"./create-element\":2,\"./w3\":30,\"./wave-skin\":32}],12:[function(a,b,c){\"use strict\";function d(a,b,c){\"string\"==typeof c&&(c=new Function(\"event\",c)),\"function\"==typeof c&&(a[b]=c)}function e(a,b){if(b.name&&document.attachEvent)try{var c=document.createElement(\"<\"+a.tagName+\" name='\"+b.name+\"'>\");a.tagName===c.tagName&&(a=c)}catch(a){console.log(a)}for(var e in b)if(b.hasOwnProperty(e)){var i=b[e];e&&null!==i&&\"undefined\"!=typeof i&&(e=f[e.toLowerCase()]||e,\"style\"===e?\"undefined\"!=typeof a.style.cssText?a.style.cssText=i:a.style=i:h[e]?(d(a,e,i),g[e]&&d(a,g[e],i)):\"string\"==typeof i||\"number\"==typeof i||\"boolean\"==typeof i?(a.setAttribute(e,i),g[e]&&a.setAttribute(g[e],i)):(a[e]=i,g[e]&&(a[g[e]]=i)))}return a}var f={rowspan:\"rowSpan\",colspan:\"colSpan\",cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",tabindex:\"tabIndex\",accesskey:\"accessKey\",hidefocus:\"hideFocus\",usemap:\"useMap\",maxlength:\"maxLength\",readonly:\"readOnly\",contenteditable:\"contentEditable\"},g={enctype:\"encoding\",onscroll:\"DOMMouseScroll\"},h=function(a){for(var b,c={};a.length;)b=a.shift(),c[\"on\"+b.toLowerCase()]=b;return c}(\"blur,change,click,dblclick,error,focus,keydown,keypress,keyup,load,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,resize,scroll,select,submit,unload\".split(\",\"));b.exports=e},{}],13:[function(a,b,c){\"use strict\";function d(a,b){b&&(a.tagName&&\"style\"===a.tagName.toLowerCase()&&document.createStyleSheet?a.cssText=b:a.canHaveChildren!==!1&&a.appendChild(b))}b.exports=d},{}],14:[function(a,b,c){\"use strict\";function d(a){var b=document.createElement(\"div\");if(b.innerHTML=a,e(b),1===b.childNodes.length)return b.firstChild;for(var c=document.createDocumentFragment?document.createDocumentFragment():document.createElement(\"\");b.firstChild;)c.appendChild(b.firstChild);return c}var e=a(\"./jsonml-trim-whitespace\");b.exports=d},{\"./jsonml-trim-whitespace\":16}],15:[function(a,b,c){\"use strict\";function d(a){return a instanceof Array&&\"string\"==typeof a[0]}function e(a,b,c){return document.createTextNode(\"[\"+a+\"-\"+c+\"]\")}var f,g,h=a(\"./jsonml-hydrate\"),i=a(\"./w3\"),j=a(\"./jsonml-append-child\"),k=a(\"./jsonml-add-attributes\"),l=a(\"./jsonml-trim-whitespace\"),m=null;f=function(a,b,c){for(var d=1;d<b.length;d++)b[d]instanceof Array||\"string\"==typeof b[d]?j(a,g(b[d],c)):b[d]&&b[d].value?j(a,h(b[d].value)):\"object\"==typeof b[d]&&null!==b[d]&&1===a.nodeType&&(a=k(a,b[d]));return a},g=function(a,b){var c;try{if(!a)return null;if(\"string\"==typeof a)return document.createTextNode(a);if(a&&a.value)return h(a.value);if(!d(a))throw new SyntaxError(\"invalid JsonML\");var k=a[0];if(!k){for(var n=document.createDocumentFragment?document.createDocumentFragment():document.createElement(\"\"),o=2;o<a.length;o++)j(n,g(a[o],b));return l(n),1===n.childNodes.length?n.firstChild:n}return\"style\"===k.toLowerCase()&&document.createStyleSheet?(f(document.createStyleSheet(),a,b),null):(c=f(document.createElementNS(i.svg,k),a,b),l(c),c)}catch(c){try{var p=\"function\"==typeof m?m:e;return p(c,a,b)}catch(a){return document.createTextNode(\"[\"+a+\"]\")}}},b.exports=g},{\"./jsonml-add-attributes\":12,\"./jsonml-append-child\":13,\"./jsonml-hydrate\":14,\"./jsonml-trim-whitespace\":16,\"./w3\":30}],16:[function(a,b,c){\"use strict\";function d(a){return a&&3===a.nodeType&&(!a.nodeValue||!/\\S/.exec(a.nodeValue))}function e(a){if(a){for(;d(a.firstChild);)a.removeChild(a.firstChild);for(;d(a.lastChild);)a.removeChild(a.lastChild)}}b.exports=e},{}],17:[function(a,b,c){\"use strict\";var d={xs:20,ys:20,xg:120,yh0:0,yh1:0,yf0:0,yf1:0,y0:5,yo:30,tgo:-10,ym:15,xlabel:6,xmax:1,scale:1,head:{},foot:{}};b.exports=d},{}],18:[function(a,b,c){\"use strict\";function d(a,b){function c(a){return a>0?Math.round(a):1}var d;b.hscale=1,b.hscale0&&(b.hscale=b.hscale0),a&&a.config&&a.config.hscale&&(d=Math.round(c(a.config.hscale)),d>0&&(d>100&&(d=100),b.hscale=d)),b.yh0=0,b.yh1=0,b.head=a.head,b.xmin_cfg=0,b.xmax_cfg=1e12,a&&a.config&&a.config.hbounds&&2==a.config.hbounds.length&&(a.config.hbounds[0]=Math.floor(a.config.hbounds[0]),a.config.hbounds[1]=Math.ceil(a.config.hbounds[1]),a.config.hbounds[0]<a.config.hbounds[1]&&(b.xmin_cfg=2*Math.floor(a.config.hbounds[0]),b.xmax_cfg=2*Math.floor(a.config.hbounds[1]))),a&&a.head&&((a.head.tick||0===a.head.tick||a.head.tock||0===a.head.tock)&&(b.yh0=20),(a.head.tick||0===a.head.tick)&&(a.head.tick=a.head.tick+b.xmin_cfg/2),(a.head.tock||0===a.head.tock)&&(a.head.tock=a.head.tock+b.xmin_cfg/2),a.head.text&&(b.yh1=46,b.head.text=a.head.text)),b.yf0=0,b.yf1=0,b.foot=a.foot,a&&a.foot&&((a.foot.tick||0===a.foot.tick||a.foot.tock||0===a.foot.tock)&&(b.yf0=20),(a.foot.tick||0===a.foot.tick)&&(a.foot.tick=a.foot.tick+b.xmin_cfg/2),(a.foot.tock||0===a.foot.tock)&&(a.foot.tock=a.foot.tock+b.xmin_cfg/2),a.foot.text&&(b.yf1=46,b.foot.text=a.foot.text))}b.exports=d},{}],19:[function(a,b,c){\"use strict\";function d(a,b,c){var d,h,i,j,k,l,m=[],n=[],o=[];for(m=a.split(\"\"),i=m.shift(),k=!1,d=1;\".\"===m[0]||\"|\"===m[0];)m.shift(),d+=1;for(n=n.concat(e(i,b,d));m.length;){for(h=i,i=m.shift(),\"<\"===i&&(k=!0,i=m.shift()),\">\"===i&&(k=!1,i=m.shift()),d=1;\".\"===m[0]||\"|\"===m[0];)m.shift(),d+=1;n=k?n.concat(f(h+i,0,d-c.period)):n.concat(f(h+i,b,d))}for(j=0;j<c.phase;j+=1)o.push(n.shift());return o.length>0?(l=g(o).length,1==g([o[o.length-1]]).length&&1==g([n[0]]).length&&(l-=1)):l=0,[n,l]}var e=a(\"./gen-first-wave-brick\"),f=a(\"./gen-wave-brick\"),g=a(\"./find-lane-markers\");b.exports=d},{\"./find-lane-markers\":5,\"./gen-first-wave-brick\":7,\"./gen-wave-brick\":8}],20:[function(a,b,c){\"use strict\";function d(a,b){var c;return c=a.data,void 0===c?null:(\"string\"==typeof c&&(c=c.split(\" \")),c=c.slice(b))}function e(a,b){var c,e,g,h,i,j=[],k=[];for(c in a)e=a[c],b.period=e.period?e.period:1,b.phase=(e.phase?2*e.phase:0)+b.xmin_cfg,j.push([]),k[0]=e.name||\" \",k[1]=(e.phase||0)+b.xmin_cfg/2,e.wave?(h=f(e.wave,b.period*b.hscale-1,b),g=h[0],i=h[1]):g=null,j[j.length-1][0]=k.slice(0),j[j.length-1][1]=g,j[j.length-1][2]=d(e,i);return j}var f=a(\"./parse-wave-lane\");b.exports=e},{\"./parse-wave-lane\":19}],21:[function(a,b,c){\"use strict\";function d(){var a,b,c,d;for(c=0,a=document.querySelectorAll(\"*\"),b=0;b<a.length;b++)a.item(b).type&&\"WaveDrom\"===a.item(b).type&&(a.item(b).setAttribute(\"id\",\"InputJSON_\"+c),d=document.createElement(\"div\"),d.id=\"WaveDrom_Display_\"+c,a.item(b).parentNode.insertBefore(d,a.item(b)),c+=1);for(b=0;b<c;b+=1)g(b,e(\"InputJSON_\"+b),\"WaveDrom_Display_\"),f(b,\"WaveDrom_Display_\");document.head.innerHTML+='<style type=\"text/css\">div.wavedromMenu{position:fixed;border:solid 1pt#CCCCCC;background-color:white;box-shadow:0px 10px 20px #808080;cursor:default;margin:0px;padding:0px;}div.wavedromMenu>ul{margin:0px;padding:0px;}div.wavedromMenu>ul>li{padding:2px 10px;list-style:none;}div.wavedromMenu>ul>li:hover{background-color:#b5d5ff;}</style>'}var e=a(\"./eva\"),f=a(\"./append-save-as-dialog\"),g=a(\"./render-wave-form\");b.exports=d},{\"./append-save-as-dialog\":1,\"./eva\":4,\"./render-wave-form\":28}],22:[function(a,b,c){\"use strict\";function d(a,b){var c,e,f={},g={x:10};for(\"string\"!=typeof a[0]&&\"number\"!=typeof a[0]||(e=a[0],g.x=25),b.x+=g.x,c=0;c<a.length;c++)\"object\"==typeof a[c]&&(\"[object Array]\"===Object.prototype.toString.call(a[c])?(f.y=b.y,b=d(a[c],b),b.groups.push({x:b.xx,y:f.y,height:b.y-f.y,name:b.name})):(b.lanes.push(a[c]),b.width.push(b.x),b.y+=1));return b.xx=b.x,b.x-=g.x,b.name=e,b}b.exports=d},{}],23:[function(a,b,c){\"use strict\";function d(a,b,c,d,h){function i(){r&&s&&(x=document.createElementNS(g.svg,\"path\"),x.id=\"gmark_\"+A.from+\"_\"+A.to,x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" \"+s.x+\",\"+s.y),x.setAttribute(\"style\",\"fill:none;stroke:#00F;stroke-width:1\"),j.insertBefore(x,null))}var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=[],A={words:[],from:0,shape:\"\",to:0,label:\"\"},B={};if(b){for(k in b)if(h.period=b[k].period?b[k].period:1,h.phase=(b[k].phase?2*b[k].phase:0)+h.xmin_cfg,m=b[k].node)for(z=m.split(\"\"),n=0;z.length;)o=z.shift(),\".\"!==o&&(B[o]={x:h.xs*(2*n*h.period*h.hscale-h.phase)+h.xlabel,y:k*h.yo+h.y0+.5*h.ys}),n+=1;if(j=document.createElementNS(g.svg,\"g\"),j.id=\"wavearcs_\"+c,a.insertBefore(j,null),d.edge)for(k in d.edge)if(A.words=d.edge[k].split(\" \"),A.label=d.edge[k].substring(A.words[0].length),A.label=A.label.substring(1),A.from=A.words[0].substr(0,1),A.to=A.words[0].substr(-1,1),A.shape=A.words[0].slice(1,-1),r=B[A.from],s=B[A.to],i(),r&&s){switch(A.label&&(p=e.parse(A.label),p.unshift(\"text\",{style:\"font-size:10px;\",\"text-anchor\":\"middle\",\"xml:space\":\"preserve\"}),p=f(p),q=f([\"rect\",{height:9,style:\"fill:#FFF;\"}]),j.insertBefore(q,null),j.insertBefore(p,null),y=p.getBBox().width,q.setAttribute(\"width\",y)),t=s.x-r.x,u=s.y-r.y,v=(r.x+s.x)/2,w=(r.y+s.y)/2,A.shape){case\"-\":break;case\"~\":x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u);break;case\"-~\":x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case\"~-\":x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c 0, 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.25*(s.x-r.x));break;case\"-|\":x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t+\",0 0,\"+u),A.label&&(v=s.x);break;case\"|-\":x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" 0,\"+u+\" \"+t+\",0\"),A.label&&(v=r.x);break;case\"-|-\":x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t/2+\",0 0,\"+u+\" \"+t/2+\",0\");break;case\"->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\");break;case\"~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u);break;case\"-~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case\"~->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c 0, 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.25*(s.x-r.x));break;case\"-|>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t+\",0 0,\"+u),A.label&&(v=s.x);break;case\"|->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" 0,\"+u+\" \"+t+\",0\"),A.label&&(v=r.x);break;case\"-|->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t/2+\",0 0,\"+u+\" \"+t/2+\",0\");break;case\"<->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\");break;case\"<~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+.3*t+\", \"+u+\" \"+t+\", \"+u);break;case\"<-~>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"M \"+r.x+\",\"+r.y+\" c \"+.7*t+\", 0 \"+t+\", \"+u+\" \"+t+\", \"+u),A.label&&(v=r.x+.75*(s.x-r.x));break;case\"<-|>\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t+\",0 0,\"+u),A.label&&(v=s.x);break;case\"<-|->\":x.setAttribute(\"style\",\"marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none\"),x.setAttribute(\"d\",\"m \"+r.x+\",\"+r.y+\" \"+t/2+\",0 0,\"+u+\" \"+t/2+\",0\");break;default:x.setAttribute(\"style\",\"fill:none;stroke:#F00;stroke-width:1\")}A.label&&(p.setAttribute(\"x\",v),p.setAttribute(\"y\",w+3),q.setAttribute(\"x\",v-y/2),q.setAttribute(\"y\",w-5))}for(l in B)l===l.toLowerCase()&&B[l].x>0&&(q=f([\"rect\",{y:B[l].y-4,height:8,style:\"fill:#FFF;\"}]),p=f([\"text\",{style:\"font-size:8px;\",x:B[l].x,y:B[l].y+2,\"text-anchor\":\"middle\"},l+\"\"]),j.insertBefore(q,null),j.insertBefore(p,null),y=p.getBBox().width+2,q.setAttribute(\"x\",B[l].x-y/2),q.setAttribute(\"width\",y))}}var e=a(\"tspan\"),f=a(\"./create-element\"),g=a(\"./w3\");b.exports=d},{\"./create-element\":2,\"./w3\":30,tspan:33}],24:[function(a,b,c){\"use strict\";function d(a,b){var c,e,f;for(b.xmax=Math.max(b.xmax,b.x),c=b.y,f=a.length,e=1;e<f;e++)\"[object Array]\"===Object.prototype.toString.call(a[e])?b=d(a[e],{x:b.x+1,y:b.y,xmax:b.xmax}):(a[e]={name:a[e],x:b.x+1,y:b.y},b.y+=2);return a[0]={name:a[0],x:b.x,y:Math.round((c+(b.y-2))/2)},b.x--,b}function e(a,b,c){var d,e,f=\" M 4,0 C 4,1.1 3.1,2 2,2 0.9,2 0,1.1 0,0 c 0,-1.1 0.9,-2 2,-2 1.1,0 2,0.9 2,2 z\",g={\"~\":\"M -11,-6 -11,6 0,0 z m -5,6 5,0\"+f,\"=\":\"M -11,-6 -11,6 0,0 z m -5,6 5,0\",\"&\":\"m -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z\",\"~&\":\"m -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z\"+f,\"|\":\"m -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z\",\"~|\":\"m -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z\"+f,\"^\":\"m -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z\",\"~^\":\"m -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z\"+f,\"+\":\"m -8,5 0,-10 m -5,5 10,0 m 3,0 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z\",\"*\":\"m -4,4 -8,-8 m 0,8 8,-8 m 4,4 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z\"},h={BUF:1,INV:1,AND:\"&\",NAND:\"&\",OR:\"â‰¥1\",NOR:\"â‰¥1\",XOR:\"=1\",XNOR:\"=1\",box:\"\"},i={INV:1,NAND:1,NOR:1,XNOR:1};return c===b&&(c=4,b=-4),d=g[a],e=h[a],d?[\"path\",{class:\"gate\",d:d}]:e?[\"g\",[\"path\",{class:\"gate\",d:\"m -16,\"+(b-3)+\" 16,0 0,\"+(c-b+6)+\" -16,0 z\"+(i[a]?f:\"\")}],[\"text\",[\"tspan\",{x:\"-14\",y:\"4\",class:\"wirename\"},e+\"\"]]]:[\"text\",[\"tspan\",{x:\"-14\",y:\"4\",class:\"wirename\"},a+\"\"]]}function f(a){var b,c,d,f=[\"g\"],g=[],h=a.length;for(b=2;b<h;b++)g.push(a[b][1]);for(c=Math.min.apply(null,g),d=Math.max.apply(null,g),f.push([\"g\",{transform:\"translate(16,0)\"},[\"path\",{d:\"M  \"+a[2][0]+\",\"+c+\" \"+a[2][0]+\",\"+d,class:\"wire\"}]]),b=2;b<h;b++)f.push([\"g\",[\"path\",{d:\"m  \"+a[b][0]+\",\"+a[b][1]+\" 16,0\",class:\"wire\"}]]);return f.push([\"g\",{transform:\"translate(\"+a[1][0]+\",\"+a[1][1]+\")\"},[\"title\",a[0]],e(a[0],c-a[1][1],d-a[1][1])]),f}function g(a,b){var c,d,e,h,i,j=[\"g\"],k=[];if(\"[object Array]\"===Object.prototype.toString.call(a)){for(d=a.length,k.push(a[0].name),k.push([32*(b-a[0].x),8*a[0].y]),c=1;c<d;c++)\"[object Array]\"===Object.prototype.toString.call(a[c])?k.push([32*(b-a[c][0].x),8*a[c][0].y]):k.push([32*(b-a[c].x),8*a[c].y]);for(j.push(f(k)),c=1;c<d;c++)j.push(g(a[c],b))}else i=a.name,e=32*(b-a.x),h=8*a.y,j.push([\"g\",{transform:\"translate(\"+e+\",\"+h+\")\"},[\"title\",i],[\"path\",{d:\"M 2,0 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z\"}],[\"text\",[\"tspan\",{x:\"-4\",y:\"4\",class:\"pinname\"},i]]]);return j}function h(a,b){var c,e,f,h,j,k,l,m,n,o,p=[\"g\"],q=[\"g\"];for(m=b.assign.length,e={x:0,y:2,xmax:0},c=b.assign,l=0;l<m;l++)e=d(c[l],e),e.x++;for(f=e.xmax+3,l=0;l<m;l++)p.push(g(c[l],f));for(j=32*(f+1)+1,k=8*(e.y+1)-7,m=4*(f+1),o=e.y+1,l=0;l<=m;l++)for(n=0;n<=o;n++)q.push([\"rect\",{height:1,width:1,x:8*l-.5,y:8*n-.5,class:\"grid\"}]);h=document.getElementById(\"svgcontent_\"+a),h.setAttribute(\"viewBox\",\"0 0 \"+j+\" \"+k),h.setAttribute(\"width\",j),h.setAttribute(\"height\",k),h.insertBefore(i([\"g\",{transform:\"translate(0.5, 0.5)\"},q,p]),null)}var i=a(\"./create-element\");b.exports=h},{\"./create-element\":2}],25:[function(a,b,c){\"use strict\";function d(a,b,c,d){var f,g,h,i,j,k,l,m,n=[];if(b){g=document.createElementNS(e.svg,\"g\"),g.id=\"wavegaps_\"+c,a.insertBefore(g,null),l=!1;for(f in b)if(d.period=b[f].period?b[f].period:1,d.phase=(b[f].phase?2*b[f].phase:0)+d.xmin_cfg,h=document.createElementNS(e.svg,\"g\"),h.id=\"wavegap_\"+f+\"_\"+c,h.setAttribute(\"transform\",\"translate(0,\"+(d.y0+f*d.yo)+\")\"),g.insertBefore(h,null),k=b[f].wave)for(n=k.split(\"\"),j=0;n.length;)m=n.shift(),\"<\"===m&&(l=!0,m=n.shift()),\">\"===m&&(l=!1,m=n.shift()),j+=l?1:2*d.period,\"|\"===m&&(i=document.createElementNS(e.svg,\"use\"),i.setAttributeNS(e.xlink,\"xlink:href\",\"#gap\"),i.setAttribute(\"transform\",\"translate(\"+d.xs*((j-(l?0:d.period))*d.hscale-d.phase)+\")\"),h.insertBefore(i,null))}}var e=a(\"./w3\");b.exports=d},{\"./w3\":30}],26:[function(a,b,c){\"use strict\";function d(a,b,c){var d,f,g,h=[\"g\"];return a.forEach(function(a,i){h.push([\"path\",{id:\"group_\"+i+\"_\"+b,d:\"m \"+(a.x+.5)+\",\"+(a.y*c.yo+3.5+c.yh0+c.yh1)+\" c -3,0 -5,2 -5,5 l 0,\"+(a.height*c.yo-16)+\" c 0,3 2,5 5,5\",style:\"stroke:#0041c4;stroke-width:1;fill:none\"}]),void 0!==a.name&&(d=a.x-10,f=c.yo*(a.y+a.height/2)+c.yh0+c.yh1,g=e.parse(a.name),g.unshift(\"text\",{\"text-anchor\":\"middle\",class:\"info\",\"xml:space\":\"preserve\"}),h.push([\"g\",{transform:\"translate(\"+d+\",\"+f+\")\"},[\"g\",{transform:\"rotate(270)\"},g]]))}),h}var e=a(\"tspan\");b.exports=d},{tspan:33}],27:[function(a,b,c){\"use strict\";function d(a,b,c,d){function g(a,b,c){var d;a[b]&&a[b].text&&(d=e.parse(a[b].text),d.unshift(\"text\",{x:a.xmax*a.xs/2,y:c,\"text-anchor\":\"middle\",fill:\"#000\",\"xml:space\":\"preserve\"}),d=f(d),j.insertBefore(d,null))}function h(a,b,c,d,g,h,k){var l,m,n,o,p=1,q=0,r=[];if(void 0!==a[b]&&void 0!==a[b][c]){if(n=a[b][c],\"string\"==typeof n)n=n.split(\" \");else if(\"number\"==typeof n||\"boolean\"==typeof n)for(m=Number(n),n=[],i=0;i<k;i+=1)n.push(i+m);if(\"[object Array]\"===Object.prototype.toString.call(n)&&0!==n.length){if(1===n.length)if(m=Number(n[0]),isNaN(m))r=n;else for(i=0;i<k;i+=1)r[i]=i+m;else if(2===n.length)if(m=Number(n[0]),p=Number(n[1]),o=n[1].split(\".\"),2===o.length&&(q=o[1].length),isNaN(m)||isNaN(p))r=n;else for(m=p*m,i=0;i<k;i+=1)r[i]=(p*i+m).toFixed(q);else r=n;for(i=0;i<k;i+=1)o=r[i],l=e.parse(o),l.unshift(\"text\",{x:i*g+d,y:h,\"text-anchor\":\"middle\",class:\"muted\",\"xml:space\":\"preserve\"}),l=f(l),j.insertBefore(l,null)}}}var i,j,k,l,m,n;for(l=2*d.hscale,m=l*d.xs,k=d.xmax/l,n=b.length*d.yo,j=f([\"g\",{id:\"gmarks_\"+c}]),a.insertBefore(j,a.firstChild),i=0;i<k+1;i+=1)j.insertBefore(f([\"path\",{id:\"gmark_\"+i+\"_\"+c,d:\"m \"+i*m+\",0 0,\"+n,style:\"stroke:#888;stroke-width:0.5;stroke-dasharray:1,3\"}]),null);g(d,\"head\",d.yh0?-33:-13),g(d,\"foot\",n+(d.yf0?45:25)),h(d,\"head\",\"tick\",0,m,-5,k+1),h(d,\"head\",\"tock\",m/2,m,-5,k),h(d,\"foot\",\"tick\",0,m,n+15,k+1),h(d,\"foot\",\"tock\",m/2,m,n+15,k)}var e=a(\"tspan\"),f=a(\"./create-element\");b.exports=d},{\"./create-element\":2,tspan:33}],28:[function(a,b,c){\"use strict\";function d(a,b,c){var d,r,s,t,u,v,w,x,y,z=0;if(b.signal){p(a,document.getElementById(c+a),b,f),h(b,f),d=e(b.signal,{x:0,y:0,xmax:0,width:[],lanes:[],groups:[]}),r=document.getElementById(\"lanes_\"+a),s=document.getElementById(\"groups_\"+a),u=i(d.lanes,f),x=m(r,u,a,f);for(y in x)z=Math.max(z,x[y]+d.width[y]);j(r,u,a,f),o(r,d.lanes,a,b,f),k(r,d.lanes,a,f),s.insertBefore(g(l(d.groups,a,f)),null),f.xg=Math.ceil((z-f.tgo)/f.xs)*f.xs,v=f.xg+f.xs*(f.xmax+1),w=u.length*f.yo+f.yh0+f.yh1+f.yf0+f.yf1,t=document.getElementById(\"svgcontent_\"+a),t.setAttribute(\"viewBox\",\"0 0 \"+v+\" \"+w),t.setAttribute(\"width\",v),t.setAttribute(\"height\",w),t.setAttribute(\"overflow\",\"hidden\"),r.setAttribute(\"transform\",\"translate(\"+(f.xg+.5)+\", \"+(f.yh0+f.yh1+.5)+\")\")}else b.assign&&(q(a,document.getElementById(c+a),b),n(a,b))}var e=a(\"./rec\"),f=a(\"./lane\"),g=a(\"./create-element\"),h=a(\"./parse-config\"),i=a(\"./parse-wave-lanes\"),j=a(\"./render-marks\"),k=a(\"./render-gaps\"),l=a(\"./render-groups\"),m=a(\"./render-wave-lane\"),n=a(\"./render-assign\"),o=a(\"./render-arcs\"),p=a(\"./insert-svg-template\"),q=a(\"./insert-svg-template-assign\");b.exports=d},{\"./create-element\":2,\"./insert-svg-template\":11,\"./insert-svg-template-assign\":10,\"./lane\":17,\"./parse-config\":18,\"./parse-wave-lanes\":20,\"./rec\":22,\"./render-arcs\":23,\"./render-assign\":24,\"./render-gaps\":25,\"./render-groups\":26,\"./render-marks\":27,\"./render-wave-lane\":29}],29:[function(a,b,c){\"use strict\";function d(a,b,c,d){var i,j,k,l,m,n,o,p,q,r=[1],s=0,t=0,u=[];for(j=0;j<b.length;j+=1)if(p=b[j][0][0],p&&(l=f([\"g\",{id:\"wavelane_\"+j+\"_\"+c,transform:\"translate(0,\"+(d.y0+j*d.yo)+\")\"}]),a.insertBefore(l,null),n=e.parse(p),n.unshift(\"text\",{x:d.tgo,y:d.ym,class:\"info\",\"text-anchor\":\"end\",\"xml:space\":\"preserve\"}),n=f(n),l.insertBefore(n,null),u.push(n.getBBox().width),q=b[j][0][1],q=q>0?Math.ceil(2*q)-2*q:-2*q,m=f([\"g\",{id:\"wavelane_draw_\"+j+\"_\"+c,transform:\"translate(\"+q*d.xs+\", 0)\"}]),l.insertBefore(m,null),b[j][1])){for(i=0;i<b[j][1].length;i+=1)o=document.createElementNS(g.svg,\"use\"),o.setAttributeNS(g.xlink,\"xlink:href\",\"#\"+b[j][1][i]),o.setAttribute(\"transform\",\"translate(\"+i*d.xs+\")\"),m.insertBefore(o,null);if(b[j][2]&&b[j][2].length&&(r=h(b[j][1]),0!==r.length))for(k in r)b[j][2]&&\"undefined\"!=typeof b[j][2][k]&&(n=e.parse(b[j][2][k]),n.unshift(\"text\",{x:r[k]*d.xs+d.xlabel,y:d.ym,\"text-anchor\":\"middle\",\"xml:space\":\"preserve\"}),n=f(n),m.insertBefore(n,null));b[j][1].length>s&&(s=b[j][1].length)}return d.xmax=Math.min(s,d.xmax_cfg-d.xmin_cfg),d.xg=t+20,u}var e=a(\"tspan\"),f=a(\"./create-element\"),g=a(\"./w3\"),h=a(\"./find-lane-markers\");b.exports=d},{\"./create-element\":2,\"./find-lane-markers\":5,\"./w3\":30,tspan:33}],30:[function(a,b,c){\"use strict\";b.exports={svg:\"http://www.w3.org/2000/svg\",xlink:\"http://www.w3.org/1999/xlink\",xmlns:\"http://www.w3.org/XML/1998/namespace\"}},{}],31:[function(a,b,c){\"use strict\";window.WaveDrom=window.WaveDrom||{};var d=a(\"./\");window.WaveDrom.ProcessAll=d.processAll,window.WaveDrom.RenderWaveForm=d.renderWaveForm,window.WaveDrom.EditorRefresh=d.editorRefresh,window.WaveDrom.eva=d.eva},{\"./\":9}],32:[function(a,b,c){\"use strict\";b.exports=window.WaveSkin},{}],33:[function(a,b,c){\"use strict\";function d(a,b){b.add&&b.add.split(\";\").forEach(function(b){var c=b.split(\" \");a[c[0]][c[1]]=!0}),b.del&&b.del.split(\";\").forEach(function(b){var c=b.split(\" \");delete a[c[0]][c[1]]})}function e(a){return Object.keys(a).reduce(function(b,c){var d=Object.keys(a[c]);return d.length>0&&(b[c]=d.join(\" \")),b},{})}function f(a){var b,c,f,i,j;if(void 0===a)return[];if(\"number\"==typeof a)return[a+\"\"];if(\"string\"!=typeof a)return[a];for(c=[],b={\"text-decoration\":{},\"font-weight\":{},\"font-style\":{},\"baseline-shift\":{},\"font-size\":{},\"font-family\":{}};;){if(f=a.search(g),f===-1)return c.push([\"tspan\",e(b),a]),c;if(f>0&&(j=a.slice(0,f),c.push([\"tspan\",e(b),j])),i=a.match(g)[0],d(b,h[i]),a=a.slice(f+i.length),0===a.length)return c}}var g=/<o>|<ins>|<s>|<sub>|<sup>|<b>|<i>|<tt>|<\\/o>|<\\/ins>|<\\/s>|<\\/sub>|<\\/sup>|<\\/b>|<\\/i>|<\\/tt>/,h={\"<o>\":{add:\"text-decoration overline\"},\"</o>\":{del:\"text-decoration overline\"},\"<ins>\":{add:\"text-decoration underline\"},\"</ins>\":{del:\"text-decoration underline\"},\"<s>\":{add:\"text-decoration line-through\"},\"</s>\":{del:\"text-decoration line-through\"},\"<b>\":{add:\"font-weight bold\"},\"</b>\":{del:\"font-weight bold\"},\"<i>\":{add:\"font-style italic\"},\"</i>\":{del:\"font-style italic\"},\"<sub>\":{add:\"baseline-shift sub;font-size .7em\"},\"</sub>\":{del:\"baseline-shift sub;font-size .7em\"},\"<sup>\":{add:\"baseline-shift super;font-size .7em\"},\"</sup>\":{del:\"baseline-shift super;font-size .7em\"},\"<tt>\":{add:\"font-family monospace\"},\"</tt>\":{del:\"font-family monospace\"}};c.parse=f},{}]},{},[31]);</script><div><script type=\"WaveDrom\">{\"signal\": [{\"name\": \"clk\", \"wave\": \"P....................x\"}, {\"name\": \"/HWSystem[HWSystem][inc]\", \"wave\": \"x0..10.10.10.10.10.10x\", \"data\": []}, {\"name\": \"/HWSystem[HWSystem][q0]\", \"wave\": \"x2...2..2..2..2..2..2x\", \"data\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]}, {\"name\": \"/HWSystem[HWSystem][q1]\", \"wave\": \"x2...2..2..2..2..2..2x\", \"data\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]}, {\"name\": \"/HWSystem[HWSystem][q2]\", \"wave\": \"x2...2..2..2..2..2..2x\", \"data\": [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\"]}], \"head\": {\"text\": \"wvf\", \"tock\": 0}}</script></div><script>WaveDrom.ProcessAll();</script>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys = py4hw.HWSystem()\n",
    "\n",
    "inc = py4hw.Wire(sys, 'inc', 1)\n",
    "q0 = py4hw.Wire(sys, 'q0', 8)\n",
    "q1 = py4hw.Wire(sys, 'q1', 8)\n",
    "q2 = py4hw.Wire(sys, 'q2', 8)\n",
    "\n",
    "py4hw.Sequence(sys, 'inc', [0, 0, 1], inc)\n",
    "\n",
    "count0 = Counter(sys, 'counter_structural', inc, q0)\n",
    "count1 = CounterRTL(sys, 'counter_rtl', inc, q1)\n",
    "count2 = CounterRTL(sys, 'counter_seq', inc, q2)\n",
    "\n",
    "print('circuit created')\n",
    "\n",
    "wvf = py4hw.Waveform(sys, 'wvf', [inc,q0,q1,q2])\n",
    "\n",
    "sys.getSimulator().clk(20)\n",
    "wvf.draw_wavedrom()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
